• 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: Can Acrobat PDF's be saved as single pages via Applescript (Brian Christmas)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can Acrobat PDF's be saved as single pages via Applescript (Brian Christmas)


  • Subject: Re: Can Acrobat PDF's be saved as single pages via Applescript (Brian Christmas)
  • From: Rick Gordon <email@hidden>
  • Date: Wed, 11 Jan 2017 01:40:25 -0800

Should it be
set Params to Params & "alert(" & dEnd & ");" & return as text

Rick Gordon

--------------------
On 1/11/17, 1:23 AM Brian Christmas said:

G’day, & thanks David

I’ve been avidly researching _javascript_, and think I have a solution that SHOULD work (but darnwell errors).

It uses a POSIX path, but gives an error      error "The variable i is not defined." number -2753 from "i”      

This error occurrs in the save line, where the ‘& (i + 1) &” is located.

Also, it’s as tho the variable dEnd isn’t being set. The line    set Params to Params & "alert(dEnd );" & return as text     does nothing.

The command 'this.numPages’  still seems to be valid in 2017, so I’m presuming somehow the script needs to address or ‘lock on’ to the document, but cannot find anything, and I’ve searched for quite a while.

I’ll post this on the _javascript_ site, but they’re proving to not be as helpful asApplescript users.
 
Regards

Santa

tell application "Adobe Acrobat"
activate
#tell document 1
set Params to ""
set Params to Params & "var cFlName = this.documentFileName;" & return as text
set Params to Params & "var dEnd =  this.numPages-1;" & return as text
set Params to Params & "alert(dEnd );" & return as text
set Params to Params & "for (i = 0; i <= dEnd-1; i+ );" & return & "{"
set Params to Params & "var _oNewDoc_ = this.extractPages(i,i);" & return as text
set Params to Params & "oNewDoc.saveAs : ~/Desktop" & "/" & "\"" & "Temporary Acrobat TIFFS" & "\"" & "/" & "\"Page " & "\"" & (i + 1) & " \"" & "\"" & cFlName & "\"" & " using: " & "\"" & ".pdf" & "\"; " & return & "}" as text
set Params to Params & "var this.closeDoc(false);" as text
do script Params
#end tell
end tell


___________________________________________
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________
WWW: http://www.shelterpub.com
 _______________________________________________
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

References: 
 >Re: Can Acrobat PDF's be saved as single pages via Applescript (Brian Christmas) (From: Brian Christmas <email@hidden>)

  • Prev by Date: Re: Can Acrobat PDF's be saved as single pages via Applescript (Brian Christmas)
  • Next by Date: Re: Keyboard Maestro does not run AS in Yosemite/El Cap
  • Previous by thread: Re: Can Acrobat PDF's be saved as single pages via Applescript (Brian Christmas)
  • Next by thread: Finder Question
  • Index(es):
    • Date
    • Thread