• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

"File/Folder Expected" Error

Community Beginner ,
Jul 14, 2017 Jul 14, 2017

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

TOPICS
Scripting

Views

999

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Valorous Hero ,
Jul 17, 2017 Jul 17, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 24, 2017 Jul 24, 2017

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines