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 script version 3 (See related posts)

// can anyone tell me what this is? Is it applescript?
How do I call it from geektool? I found this here
http://theappleblog.com/community/development/588-displaying-quicksiler-tags/#post6596

set QuicksilverTags to (path to home folder as string) & "Library:Caches:Quicksilver:Indexes:QSPresetQSFileTagsPlugIn.qsindex"

do shell script "grep string " & (quoted form of POSIX path of QuicksilverTags) & " | awk {'print $1'}"

set theTags to result

--> From the MacScripter.net Text Delimiters Tutorial.
set newText to switchText of theTags from "<string>qs.tag.file</string>" to ""
to switchText of currentText from SearchString to ReplaceString
	set storedDelimiters to AppleScript's text item delimiters
	set AppleScript's text item delimiters to SearchString
	set currentText to currentText's text items
	set AppleScript's text item delimiters to ReplaceString
	set currentText to currentText as Unicode text
	set AppleScript's text item delimiters to storedDelimiters
	
	currentText
	
	set this_text to currentText
	
	set new_text to ""
	
	--> From the MacScripter Forum.
	repeat with myPara in paragraphs of this_text
		if new_text does not contain myPara then set new_text to new_text & myPara & return
	end repeat
	set new_text to (characters 1 thru -2 of new_text) as text
	
	set more_text to new_text
	set replace_text to ""
	
	--> From MacScripter Forum.
	repeat with myPara in paragraphs of more_text
		
		if replace_text does not contain myPara then set replace_text to replace_text & (text 9 thru -10 of myPara) & return
	end repeat
	
	set output to "Tags: " & return & replace_text
	
end switchText -- the end of the handler.

Comments on this post

jamiew posts on Mar 16, 2007 at 13:44
This is in fact AppleScript. Use 'Script Editor' to save it and save it in ~/Library/Scripts and QuickSilver should pick it up automatically

You need to create an account or log in to post comments to this site.