do shell script "grep string /Users/username/Desktop/QSPresetQSFileTagsPlugIn.qsindex | awk {'print $1'}" set theTags to result set newText to switchText of theTags from "<string>qs.tag.file</string>" to "" to switchText of currentText from SearchString to ReplaceString -- the handler set storedDelimiters to AppleScript's text item delimiters -- this simply stores the current value of AppleScript's AppleScript's text item delimiters -- so they can be restored later (thus helping to avoid potential problems elsewhere). -- Remember, we always set them back to what they were. set AppleScript's text item delimiters to SearchString -- AppleScript's AppleScript's text item delimiters are now set to "Purple" set currentText to currentText's text items -- note we have changed currentText's value -- create a list of text items from the original text, separated at the points where the -- current text item delimiter ("Purple") appeared. --> {"What, ", " Shoes?"} - Note that the spaces and punctuation are retained. set AppleScript's text item delimiters to ReplaceString -- AppleScript's AppleScript's text item delimiters are now set to "Green" set currentText to currentText as Unicode text -- coerce the list {"What, ", " Shoes?"} to Unicode text. This operation will also -- insert the current value of AppleScript's AppleScript's text item delimiters ("Green") -- between each of the listed items --> "What, Green Shoes?" set AppleScript's text item delimiters to storedDelimiters -- restore the value of AppleScript's AppleScript's text item delimiters -- to whatever they were on entering the subroutine. Remember that a call to this -- might have been made from within a section of script that had the TIDs set to -- something else. Hand the result back with the TIDs as they were. currentText -- return the now modified text (and restored TIDs) -- "What, Green Shoes?" set this_text to currentText set new_text to "" --Loop through paragraphs of old text repeat with myPara in paragraphs of this_text --Check for paragraph’s contents in new text --If not there add new text to end of new text if new_text does not contain myPara then set new_text to new_text & myPara & return end repeat --Remove final return set new_text to (characters 1 thru -2 of new_text) as text end switchText -- the end of the handler.
Never been to CodeSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
quicksilver tags in geektool (See related posts)
You need to create an account or log in to post comments to this site.
Related Posts
» quicksilver tags in geektool... in shell osx applescript tagging terminal tags geektool quicksilver metadata qs textfile shellscript
» Display Quicksilver (Finder ... in osx mac tagging tags geektool quicksilver metadata qs textfile
» Testing Terminal RGB color c... in shell osx mac bash unix applescript osascript window terminal color rgb combination
» Testing Terminal RGB color c... in shell osx mac bash unix applescript osascript window terminal color rgb combination
» Testing Terminal RGB color c... in shell osx mac bash unix applescript osascript window terminal color rgb combination
» Testing Terminal RGB color c... in shell osx mac bash unix applescript osascript window terminal color rgb combination
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails