Re: Save PDF to Yojimbo and file
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]
Re: Save PDF to Yojimbo and file
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%2Fclk%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]
Re: Save PDF to Yojimbo and file
Hi there! These scripts are great! 1) Could you get it so you could select *multiple folder collections* (like in Kenneth Kirksey's script where he allows you to select multiple *tags*)? 2) How could you get the script to prompt you whether you would like to encrypt the PDF as well? I have just cut and pasted the snippets of code from Kenneth and Steve in this thread (http://www.listsearch.com/Yojimbo/Message/index.lasso?3685) together. I couldn't figure out how to do the above after much trial and error - Im new to Applescripting. Thanks in advance, Mark -- -- 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 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 allCollections to (name of every folder collection) set c to choose from list allCollections with prompt Add PDF to which collection? 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 n to folder collection named c add tags chosenTagList to n end tell if not chooseTagsFromList then set AppleScript's text item delimiters to restoreDelimiters end if end open _ Advertisement: Make shopping exciting. Find what you want at www.eBay.com.au http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Frover%2Eebay%2Ecom%2Frover%2F1%2F705%2D10129%2D5668%2D323%2F4%2F%3Fid%3D6_t=763807330_r=email_taglines_EBAY_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]
Re: Save PDF to Yojimbo and file
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]
Re: Save PDF to Yojimbo and file
On May 30, 2007, at 5:49 PM, Patrick Gilmour wrote: 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). Might need some help with this one. The name of theFile sent to the script is Print Job, not the name of the document being printed. I don't know where to grab the actual name of the document being printed. Anyone else know? -- -- 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]