Kenneth (and Steve),

Many thanks - this is a great addition.

I was wondering if it would be possible to tweak the script so that if the Name field was left blank it would use the Yojimbo default name (web pages usually have the correct "Title" tag and it would be painful to have to retype this).

Thanks again,

Pat


On May 30, 2007, at 5:38 PM, Kenneth Kirksey wrote:

A little refinement that allows you to set whether you want to choose tags from a list or enter them manually:

---------------------------------------------------------------------
-- Save PDF to Yojimbo and Tag
--
-- Allows you to rename and add tags to a Yojimbo item you add using print
-- to PDF.
--
-- Save as a script to ~Library/PDF Services
---------------------------------------------------------------------
on open (theFile)
        
        -----------------------------------------------------------------
-- set chooseTagsfromList to true if you want the script to present you with -- a list of tags to pick from. Set it to false if you want to manually enter the
        -- tags. If you manually enter tags, separate tags with commas.
        -----------------------------------------------------------------
        
        set chooseTagsFromList to true
        
set theName to text returned of (display dialog "Name:" default answer "")
        if not chooseTagsFromList then
                set restoreDelimiters to AppleScript's text item delimiters
                
                set AppleScript's text item delimiters to ","
set theTags to text returned of (display dialog "Tags:" default answer "")
                
                set the chosenTagList to every text item of theTags
        end if
        
        tell application "Yojimbo"
                set allTags to name of every tag
                if chooseTagsFromList then
                        set chosenTagList to choose from list allTags ¬
                                with title ¬
                                "Tags" with prompt ¬
                                ¬
                                        "Choose Tags:" multiple selections 
allowed true ¬
                                with empty selection allowed
                end if
                set n to import theFile
                set name of n to theName
                add tags chosenTagList to n
        end tell
        
        if not chooseTagsFromList then
                set AppleScript's text item delimiters to restoreDelimiters
        end if
end open




--
------------------------------------------------------------------
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]>


--
------------------------------------------------------------------
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