• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: problems saving pdf
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems saving pdf


  • Subject: Re: problems saving pdf
  • From: "Stockly, Ed" <email@hidden>
  • Date: Thu, 09 Apr 2015 01:08:06 +0000
  • Thread-topic: problems saving pdf

Shane beat me to it. I noticed there was some unnecessary redundancy in your script and made a few tweaks…

All it really need to function was, as Shane said, removing the conversion to POSIX path.

The error message you were getting is not very helpful, it's like a default message when there is some reason a file can't be saved. 

Hope this helps

ES

try

set sourceFile to choose file with prompt "Select a PDF file"

on error errMsg number errNum

if errNum is -128 then

display dialog "User cancelled."

else

display dialog "Unknown choose file error"

end if

return

end try

--get the file name then strip out the file extension

tell application "Finder"

set myName to name of sourceFile

set myName to ((characters 1 thru -5 of myName) as string)

end tell

set myName to myName & " FRONT.pdf"


--do acrobat stuff

tell application "Adobe Acrobat Pro"

activate

open sourceFile

set mediaSize to get media box of page 1 of active doc --get media box so our new doc can be made the same size

--make a new document then set its size to the source file size

set newFront to make new document

tell newFront

tell page 1

set media box to mediaSize

end tell

end tell

insert pages newFront after 0 from active doc starting with 1 number of pages 1 insert bookmarks no

bring to front newFront

end tell


--set the file path to save the new docs to

tell me to activate

set folderPath to choose folder with prompt "Choose a folder to save the separated pages to."

set defaultPath to (folderPath as text) & myName


--save the new doc

tell application "Adobe Acrobat Pro"

activate

tell active doc

if modified is true then

save to file (defaultPath)

end if

end tell

end tell


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: problems saving pdf
      • From: Shane Stanley <email@hidden>
References: 
 >problems saving pdf (From: RJay Hansen <email@hidden>)

  • Prev by Date: Re: problems saving pdf
  • Next by Date: Re: problems saving pdf
  • Previous by thread: Re: problems saving pdf
  • Next by thread: Re: problems saving pdf
  • Index(es):
    • Date
    • Thread