On Jun 29, 2012, at 10:07, humanengr wrote:

> If you save an open document using AppleScript, I strongly advise you to use 
> the "save" AppleScript command rather than an using a shell script. The shell 
> script is a compromise that does not do exactly the same as Skim for 
> embedding, that was developed for the case where you don't want to have to 
> open the document and/or launch the app. The command is something like 
> save as "PDF With Embedded Notes" in theFile
> Christiaan
> Going that route, I have:
> 
> tell application "Skim"
> 
> set _file to front document's file
> 
> set _filename to front document's file as string
> 
> tell application "Finder" to set _ext to name extension of (info for _file)
> 
> if _ext is "pdf" then
> 
> set _end to (length of ".pdf") + 1
> 
> set _basename to (characters 1 thru -_end of _filename) as string
> 
> save front document in _basename as "PDF With Embedded Notes"
> 
> tell application "Finder" to say "embedded"
> 
> else
> 
> tell application "Finder" to say "not a pdf"
> 
> end if
> 
> end tell
> 
> But if I run the script and then close the file, a "save" dialog appears, to 
> which the user must respond "Don't Save" to preserve the embedding. I'm 
> probably missing an obvious way to prevent that dialog from appearing.
> 

No, there is no way to prevent it, other from actually saving the changes (so 
you could save and then save with embedded notes on top of it). But this is not 
in any way related to using a different way of saving with embedded notes. The 
reason you did not get it in the previous AppleScript was because you did save 
(without embedding) explicitly. Quite frankly, it also does not make sense to 
save the way you did before, because you save a file *without* embedded notes 
over a file *with* embedded notes, so in the end you were not even ending up 
with a file with embedded notes.

Christiaan

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Skim-app-users mailing list
Skim-app-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-users

Reply via email to