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