/* TagClipper - An AutoHotkey script for fast auto-tagging webpages, files, images and thoughts. This script is designed to help you quickly and unobtrusively index information, files and thoughts. The advantage thiis script has is it's simplicity and speed, with workflow interruption kept to a minimum. I have found this a very effective indexing method for those nuggets of information I find on the web, files that I want to sort later, webimages, and quick thoughts or To-Dos. When I clip information from a web-page, that text will already contain the main keywords / tags that can help me find my way back to the source. So the text snippet really 'tags' the webpage, or file. No need to enter seperate tags,, this saving time and key-presses. Clips are easy and fast to collect, are timestamped, and contain the url or path to the original reference. Clips are saved in the Dayfile. Dayfiles are automatically created every day, and are named by date, in the format: YYYY=MM-DD.txt. On first run the script creates a "Notes" folder in your root drive (e.g. C:\Notes\) All your clips and their references are collected in the Dayfile for later processing (I'm working on a search interface) Now you're ready to go! Start clipping with the hotkeys below. Hope you find it useful! I certainly have. _______________ Win+w: WEBCLIP1 - Copy & Paste selected webpage text and the URL reference to the Dayfile ______________ Alt+w: WEBCLIP2 - Saves the existing clipboard contents as clip to Dayfile Use in conjunction with Alt1 or CapsLock, which has been re-mapped to append current selected text to clipboard. Usng this combo you can collect diverse clips froom throughout a webpage. These are saved as a single websnippet. Normal Capslock function is accessed using shift+caplock. Try iit! _____________ Win+f: FILECLIP - Opens a file selector and then a textbox. The label/text are saved, along with the full filepath, in the Dayfile. __________ Win+c: CLIP - Opens a text box. Entered label and text are saved in the Dayfile. _______________ Win+I: IMAGECLIP - Copies the Image URL referenced by current mouse position, then textbox. Saved to Dayfile. _______________ Alt+1 or CapsLock: (1) Append paragraph plus selected text to clipboard. _____ Alt+2: Save Clipboard contents as websnippet (replicates Alt+w) _____ Alt+3: Remove whitespace and formatting from clipboard text _____ Alt+4: Remove ALL whitespace, including carriage returns _____ Alt+5: Swaps selected text with text from the clipboard Next steps: = Write a regex report geberator for the clip files 080614JHClipTagger */ ; Forces singe instance of this script #SingleInstance force ;Check for existence of DayFile and Notes directory. Creates these if not existing IfNotExist, c:\Notes\ MsgBox, All notes will be stored in the Notes folder at the root of your drive`r`re.g.C:\Notes\`r`r IfNotExist, c:\Notes\ FileCreateDir, c:\Notes\ ;____________________________________________________________________________________ ; GLOBAL VARIABLES ;____________________________________________________________________________________ ; Create date variables FormatTime, TodaysDate,, yyyy-MM-dd ; todays date FormatTime, TimeNow,, HH:mm:ss ; timestamp FormatTime, YearToday,, yyyy ; Year ;____________________________________________________________________________________ ; FUNCTIONS ;____________________________________________________________________________________ ;REMOVE WHITESPACE Whitespace(str) { xAT := A_AutoTrim AutoTrim, Off Loop, Parse, str { If A_LoopField is space IfEqual, xs, 1, Continue Else xs = 1 Else xs = 0 s =%s%%A_LoopField% } AutoTrim, %xAT% Return, s } ;____________________________________________________________________________________ ; CLIP COMMANDS - ALT+1...0 ;____________________________________________________________________________________ ; Useful Clipboard hokey additions ; Ja's version 2008 !1:: ; (1) Append newline plus selected text to clipboard. oldclip = %clipboard% Send, ^c Clipwait, 1 clipboard = %oldclip%`r`r`n%clipboard% Return !2:: ; (2) Send Clipboard contents to websnippet Send !w Return !3:: ; (6)Remove whitespace and formatting from clipboard text ClipBoard = %ClipBoard% ; Convert to text StringReplace, clipboard, clipboard, `n, , All ; remove newlines from clipboard text string = %clipboard% clipboard = % Whitespace(string) ; invoke Remove Whitespace function Return !4:: ; (4) Remove ALL whitespace, including carriage returns ClipBoard = %ClipBoard% ; Convert to text StringReplace, clipboard, clipboard, `r`n, , All ; remove newlines from clipboard text string = %clipboard% clipboard = % Whitespace(string) ; invoke Remove Whitespace function Return !5:: ; (5) Swaps selected text with text from the clipboard clipOne = %clipboard% Send, ^c clipTwo = %clipboard% clipboard = %clipOne% Send, ^v clipboard = %clipTwo% Return !0:: ; (0) Clear, Ctrl+Shift+X, clear the clipboard clipboard = ;clears clipboard Return ; Change CapsLock key into something useful: Capslock::Send !1 ; To use Capslock, if ever, use shift +Capslock::Capslock ;____________________________________________________________________________________ ; ACETEXT CLIPPERS - WIN+ ; All notes are saved in the dayfile - generated automatically each day in format yymmdd ;____________________________________________________________________________________ !w:: ; WEBCLIP - Saves clipboard contents as clip with URL reference NoteBody = %clipboard% Send !d Send ^c ClipWait, 1 NoteUrl = %clipboard% ;Remove all CR+LF's ;StringReplace, NoteBody, Notebody, `r`n, , All ;Remove all whitespace NoteBody = % Whitespace(NoteBody) ; Append the old txt (minus end tags) plus new clip + new end tags to new txt file Text = `nWebClip@%TimeNow%`r`n%NoteBody%`r`n`nURL: %NoteUrl%`r`n`n FileAppend, %Text%, \Notes\%TodaysDate%.txt Return ;______________________________________________ #w:: ; WEBCLIP - Copy & Paste selected webpage text and the URL reference to the dayfile Send ^c NoteBody = %clipboard% Send !d Send ^c ClipWait, 1 NoteUrl = %clipboard% ;Remove all CR+LF's ;StringReplace, NoteBody, Notebody, `r`n, , All ;Remove all whitespace ;NoteBody = % Whitespace(NoteBody) ; Append the old txt (minus end tags) plus new clip + new end tags to new dayfilefile Text = `nWebClip@%TimeNow%`r`n%NoteBody%`r`n`nURL: %NoteUrl%`r`n`n FileAppend, %Text%, \Notes\%TodaysDate%.txt Return ;__________________________________________ #f:: ; Opens a file selector and then a textbox. File location and text / tags are stored in dayfile ;Clear variables NoteBody = NoteTag = Gui, Destroy ;Clears the GUI space FileSelectFile, SelectedFile, 3, \DOCS\, Choose a file, All Files (*.*) if SelectedFile = Return else Gui, Add, Edit, w350 h100 vEditBox Gui, Add, Button, Default gSubmitA, Tag this fiile! Gui, Show Return SubmitA: Gui, Submit GuiControlGet, Text,, EditBox if Text = Send {Space} else NoteBody = %Text% Text = `nFile@%TimeNow%`r`n%NoteBody%`r`n`nFile: %SelectedFile%`r`n`n FileAppend, %Text%, \Notes\%TodaysDate%.txt Return ;____________________________________________ #c:: ;Collect a quick thoght and send to dayfile ;Clear variables NoteBody = Gui, Destroy ;Clears the GUI space Gui, Add, Edit, w350 h100 vEditBox Gui, Add, Button, Default gSubmitD, Enter you clip! Gui, Show Return SubmitD: Gui, Submit GuiControlGet, Text,, EditBox if Text = Return else NoteBody = %Text% Text = `nThought@%TimeNow%`r`n%NoteBody%`r`n`n FileAppend, %Text%, \Notes\%TodaysDate%.txt Return ;____________________________________________________________________________________ ; Capture Web Image URL to dayfile with tags/text- ALT+ ; ALT+arrow keys control the recorder ;____________________________________________________________________________________ #i:: ;Copies the Image location as an acetext WebSnippet Gui, Destroy ;Clears the GUI space ;Clear all variables clipboard = NoteBody = NoteUrl = Sendplay {Click right} Send o Clipwait NoteUrl=%clipboard% Gui, Add, Edit, w350 h100 vEditBox Gui, Add, Button, Default gSubmitE, Tag this image! Gui, Show Return SubmitE: Gui, Submit GuiControlGet, Text,, EditBox if Text = Send {Space} else NoteBody = %Text% Text = `nImage@%TimeNow%`r`n%NoteBody%`r`n`nImageURL: %NoteUrl%`r`n`n FileAppend, %Text%, \Notes\%TodaysDate%.txt Return