A couple of you here on the list, Jim DeVona I know, and another I'm sorry I can't recall, have been kind and talented enough to script YJ and to assist me in doing so. Below are two scripts written by these two (one?) people and I would love to know how to merge them such that I get an exported collection in a folder with Spotlight tags for the items intact. Script One (Mr. Devona's) exports items with tags. Script Two exports collections of items, but no tags. Folders are created manually in both cases. This would be handy for anyone who has a large library. Any solutions appreciated. I am clearly not up to the task.
-J
Script One
property _delimiter : ", "
tell application "Yojimbo"
set _items to selected items of browser window 1 if _items is missing value then return set _itemc to count of (_items as list) activate
-- select a destination and export items if _itemc is 1 then set _dst to choose file name with prompt "Export selected item as:" default name (get name of item 1 of _items) else set _dst to choose folder with prompt "Export selected items to:" end if set _files to export _items to _dst
-- fess up when we don't know what to do set _filec to count of (_files as list) if _filec is not equal to _itemc then display alert "Export with Comment Tags error:" message "The number of exported files (" & _filec & ") does not match the number of selected items (" & _itemc & "). Comment tags cannot be applied." as critical return end if
-- apply any tags from each item to each corresponding file set _tid to AppleScript's text item delimiters set AppleScript's text item delimiters to {_delimiter} repeat with _i from 1 to _itemc set _tags to name of tags of item _i of _items if (count of _tags) is greater than 0 then set _comments to _tags as string set _file to item _i of (_files as list) tell application "Finder" to set comment of (_file as alias) to _comments end if end repeat set AppleScript's text item delimiters to _tid
end tell
Script Two
tell application "Yojimbo" tell front browser window set colls to selected collections repeat with coll in colls set everyi to every database item of coll set destination to ((path to desktop folder) as text) tell application "Finder" make new folder at destination with properties {name:name of coll} end tell export everyi to destination & name of coll (*remove everyi etc.*) end repeat end tell end tell
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Yojimbo Talk" group. To post to this group, send email to yojimbo-talk@googlegroups.com To unsubscribe from this group, send email to yojimbo-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/yojimbo-talk?hl=en -~----------~----~----~----~------~----~------~--~-
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!