Skip to main content
Participating Frequently
May 14, 2013
Question

Incremental Numbering for File Names

  • May 14, 2013
  • 1 reply
  • 1422 views

I've been trying to wrap my head around this problem all day. So I've found two very helpful scripts on this forum: here and here. The second one works, but I'd like to be able to direct where the files are saving to and I'd like to save them as .tifs. It seems like the first script is exactly the one I want, but when I run it I get the following error (I have CS 5):

I'm trying to use this as a learning exercise, but man, it's a steep curve.

Thanks

jonathan.

This topic has been closed for replies.

1 reply

Inspiring
May 15, 2013

From that error message I would say that you have a bad file path. The saveAs() command will not create subfolders if they do not exists. At a guess you are trying to create a new folder and save to that folder in one step. You need to first create the folder, then you can save to it.

Or if the D: drive on your system is a CD/DVD drive then that may be the problem.

adraftAuthor
Participating Frequently
May 15, 2013

Thank you for your response. The script only works for me when I have it save to a folder, which is fine. For some reason specifying subfolders (already existing ones) brings up that error message again.

This will work for me, though. Thanks again.

Inspiring
May 15, 2013

You should be able to save to an existing subfolder unless it's a folder that can't be written to because of user permissions.

Can you post the line that defines 'saveFile'? It could be that you are not creating the path correctly. It's had to tell from the error message as some of the path looks like it was replaced with '...'