On 10/27/07, Mark F <[EMAIL PROTECTED]> wrote:
>
> Thanks Jim! I will give it a go.
>
> Ideally, I would like it to display the tag dialog box (i.e. with the list of 
> my Yojimbo tags), with the Spotlight comments to also appear in the same 
> dialog box but as highlighted/selected. That way I could easily select which 
> tags I want the item to have, whether they be pre-existing Yojimbo tags or 
> Spotlight comments (of course there is also a chance that I have the same tag 
> in my Yojimbo list of tags as well as in the Spotlight comments of the item 
> I'm importing – so if that happens I would need the dialog box to display 
> just the Spotlight tag so as to not have the same tag listed twice in the 
> dialog box tag list.)
>
> Any ideas on whether that would be possible?

Sure, basically you want to concatenate the list of tags that came
from the Finder comments to the list of tags from Yojimbo.

So, try inserting this version of the tags-from-comments code in your
import script just after the "set allTags to name of every tag" line:

tell application "Finder" to set theComments to comment of theFile
set originalDelimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to " "
set allTags to allTags & every text item of theComments
set AppleScript's text item delimiters to originalDelimiters

Note that all the "text item delimiter" stuff just makes it easier to
use a different delimiter like "," instead of " ". If you'll
definitely be using spaces, you can simplify things a bit:

tell application "Finder" to set theComments to comment of theFile
set allTags to allTags & words of theComments

or probably even:

tell application "Finder" to set allTags to allTags & words of the
comment of theFile

This example doesn't remove duplicates. I don't know if it's the most
concise method, but here's one way:
http://www.rosettacode.org/wiki/Create_a_Sequence_of_unique_elements#AppleScript

Jim

--
------------------------------------------------------------------
This message is sent to you because you are subscribed to
  the mailing list <yojimbo-talk@barebones.com>.
To unsubscribe, send mail to: <[EMAIL PROTECTED]>
List archives:  <http://www.listsearch.com/yojimbotalk.lasso>
Have a feature request, or not sure if the software's working
correctly? Please send mail to: <[EMAIL PROTECTED]>

Reply via email to