Many thanks Mark.  I have been looking for something like this.

I'm encountering a strange problem with the script though.

When I run it in Safari, I get the following error:  "Error while printing."

I look in Yojimbo, and the pdf is there and it is named and tagged
appropriately.  I noticed that if it is a page with some images, some of
those images are missing.  I'm not sure if this is usually the case or
somehow relates to the error.  I tried news.yahoo.com and www.google.com as
well as some other random pages.  Same error.

The strange thing is that I don't get the error if I run the script from
another application like Firefox.  I don't get it in Entourage or Word
either.  Just Safari, from what I can tell.  I am using Version 2.0.4
(419.3) of Safari.

Here is the script I am using (I turned off tag selection and Choose
Collection):

on open (theFile)
    
    set chooseTagsFromList to false
    set chooseCollectionsFromList to false
    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 allCollections to (name of every folder collection)
        if chooseCollectionsFromList then
            set chosenCollectionList to choose from list allCollections ¬
                with title ¬
                "Collections" with prompt ¬
                ¬
                    "Add PDF to which collection?" 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
        repeat with i from 1 to the count of chosenCollectionList
            add n to folder collection named (item i of
chosenCollectionList)
        end repeat
        
    end tell
    
    if not chooseTagsFromList then
        set AppleScript's text item delimiters to restoreDelimiters
    end if
end open

----

I'm wondering what the issue is and am torn between switching back to
Firefox and the convenience of your script.

Thanks!

-Henry

On 7/21/07 10:02 PM, "Mark F" <[EMAIL PROTECTED]> wrote:

> I have figured out how to get Yojimbo to add the PDF to multiple folder
> collections (see below).
> 
> Does anyone know how I could also encrypt the PDF in applescript as well?
> 
> [code]
> ----------------------------------------------------------
> -- 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 chooseCollectionsFromList 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 allCollections to (name of every folder collection)
> if chooseCollectionsFromList then
> set chosenCollectionList to choose from list allCollections ¬
> with title ¬
> "Collections" with prompt ¬
> ¬
> "Add PDF to which collection?" 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
> repeat with i from 1 to the count of chosenCollectionList
> add n to folder collection named (item i of chosenCollectionList)
> end repeat
> 
> end tell
> 
> if not chooseTagsFromList then
> set AppleScript's text item delimiters to restoreDelimiters
> end if
> end open
> [/code]
> 
> _________________________________________________________________
> Advertisement: New jobsjobsjobs.com.au. Find thousands of jobs online now!
> http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fad%2Eau%2Edoubleclick%2Enet%2F
> clk%3B114014868%3B17770752%3Bi%3Fhttp%3A%2F%2Fwww%2Ejobsjobsjobs%2Ecom%2Eau&_t
> =762242361&_r=Hotmail_email_tagline_July07&_m=EXT
> 



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