Copy link to clipboard
Copied
I cannot seem to debug an error I am getting from an Applescript that is adapted from the business card template that ships with Illustrator. Specifically, at the line "update dataset i of document currentDoc" I am getting an error "File/Folder expected." I am happy to post the entire script but, before doing so, does anyone see anything obviously wrong with the below which may be causing this error?
Thank you in advance for any assistance:
tell application "Adobe Illustrator"
activate
set mysetcount to myindex - 1
repeat with i from 1 to mysetcount
import variables document currentDoc from alias XMLfilePath
set pathText to item i of filePaths
update dataset i of document currentDoc
set mynewfile to exportFolder & "CaseNo" & i & "-productsource.pdf" as string
set myfile to file path of document currentDoc
save document currentDoc in file mynewfile as pdf
close document 1 saving no
open myfile
end repeat
end tell
end if
end batchExport
Copy link to clipboard
Copied
These always get me, for me I always have to think and re-think how the files and folders an POSIX files and POSIX folders and paths of each all relate to each other in AppleScript. Then, after much trial and error I have some snippet which I copy/paste across all my AppleScripts. In my case it's always been a matter of converting regular files/folders to POSIX ones and vice-versa.
Copy link to clipboard
Copied
Hi
Just add a delay after importing variables to compensate for the time the variables gets loaded to illustrator., add this:
delay 1
hope it helps