|
|||||||
| Development XCode, Cocoa, and all other development |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
| 02-27-2007 | #1 (permalink) |
|
Operator
Join Date: Dec 2006
Posts: 9
![]() |
Having just started to use Tags with Quicksilver I'd like to display the Tags I've already used on my desktop with GeekTool.
I've found where Quicksilver stores the Tags and I've got a basic command to get the Tags out of the file but I could do with some help removing the duplicates and extra text. Here's the code: Code:
grep string /Users/username/Library/Caches/Quicksilver/Indexes/QSPresetQSFileTagsPlugIn.qsindex | awk {'print $1'} > /Users/username/Desktop/tags.txt
<string>guides</string> <string>guides</string> <string>qs.tag.file</string> <string>scripts</string> <string>scripts</string> <string>qs.tag.file</string> <string>Guide</string> <string>Guide</string> <string>qs.tag.file</string> I'd like to remove the <string>qs.tag.file</string> lines and the <string> </string> Does anyone know how to do this? |
|
|
|
| 02-28-2007 | #3 (permalink) |
|
Operator
Join Date: Dec 2006
Posts: 9
![]() |
With help from MacScripter.net, here's the finished scritp:
Code:
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.
|
|
|
|
| 03-07-2007 | #4 (permalink) |
|
Operator
Join Date: Mar 2007
Posts: 1
![]() |
You need to copy the script into "Script Editor" and save it as "GetTags.scpt"
In GeekTool create a new entry with the command Code: osascript /Users/username/path/to/script/GetTags.scpt Hope this helps. ![]() Yes. It does help a lot. So in 13 point type I can display all my tags. Anyone know how to make that text file or geektool wordwrap or start a second column? Hmm. We didn't even actually create a text file per se. I think the mac scripter forum mentioned is here. Last edited by paynito; 03-07-2007 at 09:55 AM. Reason: spelling mistake |
|
|
|
| 03-08-2007 | #5 (permalink) | |
|
Operator
Join Date: Dec 2006
Posts: 9
![]() |
Quote:
As for having GeekTool wordwrap, I don't think that's possible. If you can create a text file with the tags in columns then GeekTool will display that. |
|
|
|
|
| 03-20-2007 | #6 (permalink) |
|
Operator
Join Date: Mar 2007
Posts: 2
![]() |
This is a great script! I have no knowledge of Applescript whatsoever, yet I have been able to get it to work.
However, it displays my tags as a (seemingly) random list of words -- is there any way to alphabetize it by modifying the script (or otherwise)? |
|
|
|
| 03-20-2007 | #7 (permalink) | |||
|
Concierge
|
Quote:
Quote:
Quote:
If you want reverse order, use "sort -r" instead of "sort" Last edited by mdmunoz; 03-20-2007 at 10:27 PM. |
|||
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|