Adding spotlight tags?

Sharing and discussing custom actions for LaunchBar
sylvaticus
Posts: 6
Joined: Mon Nov 16, 2009 1:58 am

Re: Adding spotlight tags?

Post by sylvaticus » Mon Nov 16, 2009 5:46 am

Hello!

I switched to Macs last year and just discovered LaunchBar a few days ago. I bought it immediately! I am already happy with it, and I'm more excited to see what's possible as I became more familiar with the application!!!!

I'm also new to the idea of tagging, and tagging using LB seems the perfect combination. However, I have no idea how to use Automator or AppleScript to create my own tagging. Your script seems like a good start, but I have no idea how to implement it, how to go from start to finish. Could someone please help me figure this out?

I did, on my own, create an automator app that seems to be adding tags to Spotlight Comments, so maybe that's all I need, and then I can invoke my app using LB?

Also, I'm a bit unclear about the difference between "tags" (keywords?) in Spotlight Comments, and "tags" created using (in?) OpenMeta.

Thank you for any possible help, and thank you Objective Development for such a great app!

Best regards,

Keith

ptujec
Wizard
Wizard
Posts: 321
Joined: Fri Dec 19, 2008 11:36 am
Contact:

Re: Adding spotlight tags?

Post by ptujec » Mon Nov 16, 2009 11:50 am

sylvaticus wrote:Hello!

I switched to Macs last year and just discovered LaunchBar a few days ago. I bought it immediately! I am already happy with it, and I'm more excited to see what's possible as I became more familiar with the application!!!!

I'm also new to the idea of tagging, and tagging using LB seems the perfect combination. However, I have no idea how to use Automator or AppleScript to create my own tagging. Your script seems like a good start, but I have no idea how to implement it, how to go from start to finish. Could someone please help me figure this out?

I did, on my own, create an automator app that seems to be adding tags to Spotlight Comments, so maybe that's all I need, and then I can invoke my app using LB?

Also, I'm a bit unclear about the difference between "tags" (keywords?) in Spotlight Comments, and "tags" created using (in?) OpenMeta.

Thank you for any possible help, and thank you Objective Development for such a great app!

Best regards,

Keith


Check http://www.screencastsonline.com/index_ ... ar5pt1.php
He also creates an applescript in this. Maybe he will cover other scripts in on of the next casts.

1) Take the code here viewtopic.php?p=10576#p10576
2) Paste it into a new window of AppleScript Editor.app
3) Save into "~/Library/Application Support/LaunchBar/Actions" (BTW: "~" is your useraccount)
4) Select your files to be tagged than hit Tab and select the script

Thats it.

sylvaticus
Posts: 6
Joined: Mon Nov 16, 2009 1:58 am

Re: Adding spotlight tags?

Post by sylvaticus » Mon Nov 16, 2009 5:09 pm

My sincerest thanks!

Also, does anyone have an answer to my other question:

Also, I'm a bit unclear about the difference between "tags" (keywords?) in Spotlight Comments, and "tags" created using (in?) OpenMeta.


Regards,

Keith

iRounak
Rank 4
Rank 4
Posts: 191
Joined: Fri Oct 23, 2009 7:11 pm
Contact:

Re: Adding spotlight tags?

Post by iRounak » Fri Dec 04, 2009 5:12 pm

And how about searching the tags/comments:
Bring this script in LaunchBar, press space, type search query and press return.

Code: Select all

on handle_string(thequery)
   try
      tell application "LaunchBar" to hide
      set thecmd to "mdfind   'kMDItemFinderComment == " & quote & thequery & "*" & quote & "wc'"
      set theresult to do shell script thecmd
      set thelist to {}
      set allparas to every paragraph in theresult
      repeat with apara in allparas
         set end of thelist to (POSIX file apara) as alias
      end repeat
      if thelist is {} then set thelist to "No items were found"
      tell application "LaunchBar"
         set selection to thelist
         activate
      end tell
   on error e
      tell me to activate
      display dialog e
   end try
end handle_string

ptujec
Wizard
Wizard
Posts: 321
Joined: Fri Dec 19, 2008 11:36 am
Contact:

Re: Adding spotlight tags?

Post by ptujec » Fri Dec 04, 2009 9:00 pm

iRounak wrote:And how about searching the tags/comments:
Bring this script in LaunchBar, press space, type search query and press return.


Great work! Like it. I was about to say that there is Spotlight for that, but this is really cool with the selection and so on …
Thanks man!

edo
Posts: 12
Joined: Fri Dec 04, 2009 10:16 pm
Contact:

Re: Adding spotlight tags?

Post by edo » Fri Dec 04, 2009 10:21 pm

Thanks iRounak.
Just replace "kMDItemFinderComment" with "kMDItemOMUserTags" and you can search OpenMeta tags.

(Zivio Ptujec, pozdrav iz Splita.)

ptujec
Wizard
Wizard
Posts: 321
Joined: Fri Dec 19, 2008 11:36 am
Contact:

Re: Adding spotlight tags?

Post by ptujec » Fri Dec 04, 2009 10:41 pm

edo wrote:Thanks iRounak.
Just replace "kMDItemFinderComment" with "kMDItemOMUserTags" and you can search OpenMeta tags.

(Zivio Ptujec, pozdrav iz Splita.)


Which apps use OpenMeta tags? Where are these tags stored?

(… in hvala za pozdrav. Lep pozdrav nazaj s Ptuja ☺)

edo
Posts: 12
Joined: Fri Dec 04, 2009 10:16 pm
Contact:

Re: Adding spotlight tags?

Post by edo » Fri Dec 04, 2009 10:46 pm

ptujec wrote:
edo wrote:Thanks iRounak.
Just replace "kMDItemFinderComment" with "kMDItemOMUserTags" and you can search OpenMeta tags.

(Zivio Ptujec, pozdrav iz Splita.)


Which apps use OpenMeta tags? Where are these tags stored?

(… in hvala za pozdrav. Lep pozdrav nazaj s Ptuja ☺)


http://code.google.com/p/openmeta/

Edo

iRounak
Rank 4
Rank 4
Posts: 191
Joined: Fri Oct 23, 2009 7:11 pm
Contact:

Re: Adding spotlight tags?

Post by iRounak » Sat Dec 05, 2009 3:43 am

Why use OpenMeta Tag instead of spotlight comments?

sjk
Wizard
Wizard
Posts: 315
Joined: Thu Sep 13, 2007 9:46 pm
Location: Eugene
Contact:

Re: Adding spotlight tags?

Post by sjk » Sat Dec 05, 2009 11:39 pm

iRounak wrote:Why use OpenMeta Tag instead of spotlight comments?

Issues with using Spotlight comments for general tagging, which partly inspired OpenMeta, have been thoroughly discussed on the Ironic Support Forum.

Really, there's a wealth of information there about various issues with both. I'll see if I can find a few specific threads later and post links. Also check the OpenMeta Google Group, for more technically-oriented topics (with some "politics" thrown in ;)).

sylvaticus
Posts: 6
Joined: Mon Nov 16, 2009 1:58 am

Re: Adding spotlight tags?

Post by sylvaticus » Sun Dec 06, 2009 9:46 pm

This is all so amazing, and a bit overwhelming! I'm going to have think about and play with it.

Thank you so much!

Now, I tell friends that not only should they buy a Mac, but they should install LaunchBar. :-)

ptujec
Wizard
Wizard
Posts: 321
Joined: Fri Dec 19, 2008 11:36 am
Contact:

Re: Adding spotlight tags?

Post by ptujec » Tue Dec 08, 2009 12:37 pm

iRounak wrote:And how about searching the tags/comments:
...


Actually I like that much that I wish it would include file names and iptc keywords (which I use for tagging fotos) too. Maybe Exif Tool would help for the later.

iRounak
Rank 4
Rank 4
Posts: 191
Joined: Fri Oct 23, 2009 7:11 pm
Contact:

Re: Adding spotlight tags?

Post by iRounak » Tue Dec 08, 2009 1:54 pm

Actually I like that much that I wish it would include file names and iptc keywords (which I use for tagging fotos) too.

what exactly do you want to search. If you could elaborate, I might be able to write a script. By file names, did you mean you wanted to search just files, not folders (which has nothing to do with comments)?

ptujec
Wizard
Wizard
Posts: 321
Joined: Fri Dec 19, 2008 11:36 am
Contact:

Re: Adding spotlight tags?

Post by ptujec » Tue Dec 08, 2009 2:36 pm

iRounak wrote:
Actually I like that much that I wish it would include file names and iptc keywords (which I use for tagging fotos) too.

what exactly do you want to search. If you could elaborate, I might be able to write a script. By file names, did you mean you wanted to search just files, not folders (which has nothing to do with comments)?


Great!
I would like to have the script looking for the query in file/folder names plus relevant metadata (spotlight comments, iptc keywords, exif … maybe also openmeta?). The only thing I don't want to have it look is the actuall content because this would be to broad.
Some option like search for "all" or "any" would be nice, too.

BTW: Maybe this is a help.

iRounak
Rank 4
Rank 4
Posts: 191
Joined: Fri Oct 23, 2009 7:11 pm
Contact:

Re: Adding spotlight tags?

Post by iRounak » Tue Dec 08, 2009 3:48 pm

To ptujec,
for searching files/folders/comments, see
viewtopic.php?f=24&t=3620

Also, for adding comments see: viewtopic.php?f=24&t=3481

Post Reply