1 Replies - 525 Views - Last Post: 14 June 2016 - 11:38 AM

#1 ge∅  Icon User is online

  • D.I.C Lover

Reputation: 175
  • View blog
  • Posts: 1,117
  • Joined: 21-November 13

intermittent "Cannot find folder" error with scripts on MacOS

Posted 10 June 2016 - 03:38 AM

Hello Folks,

As a graphic designer I'm a user of the app Indesign, which allows scripting in various languages, including Javascript.

When I try to export my work as PDF, there is this typical line of code that breaks once in a while for no apparent reason :
File(document.filePath.fsName + "../" + exportFolder + "/" + lang + "/" + fileName + ".pdf");



Sometimes it works, sometimes it will give me a "Cannot find folder" error. The same script, the same path, the same user session. Restarting the computer has solved the issue once. I cannot tell if it will always be the case. Since the problem is not constant, it's difficult to reproduce and troubleshoot (moreover, when the script breaks I'm usually on a deadline and I need to get shit done)

document.filePath.fsName (or document.filePath.absoluteURI, I use them interchangeably) gives me the absolute path of the Indesign document's folder. I usually write my files in a parent folder to keep things tidy, so the URI has a part that is relative (../)

You can find documentation about the File class here : http://jongware.mit....js/pc_File.html but I would think it is more likely to be a system-level issue. Maybe a corrupted index or cache. Something I could clear with a magic command line that would do what restarting the computer has done once.

Any thoughts ?
Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: intermittent "Cannot find folder" error with scripts on MacOS

#2 ge∅  Icon User is online

  • D.I.C Lover

Reputation: 175
  • View blog
  • Posts: 1,117
  • Joined: 21-November 13

Re: intermittent "Cannot find folder" error with scripts on MacOS

Posted 14 June 2016 - 11:38 AM

I've got news !

We have a server at the office that I can mount as a volume.

I tried to access it during a batch export this evening and the export failed in the middle of the script with the same error.

Unmounting the volume made the script work again.


I rarely access it so I doubt it is what caused the previous failures, but I can't be sure, and at least it's a start.

What do you think could be happening ?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1