More efficiency learnings for Kevin…
I already have a script that does all this, but I know I’m doing it the tedious way since my script is hugely long and I’m reasonably sure this can be done with list handling, which I’m not yet very good at.
Here’s what the script needs to do:
–user can drag-n-drop any combination of a single file, multiple files, a single folder, multiple folders, and even subfolders. In other words, not be too picky about WHAT is dropped onto it.
–the script ignores the folders and simple should give a list of file paths that it needs to perform operations on in a repeat loop
–the script, based on a flag set by other conditions (think global field) will sometimes need to rename the file, but still keep proper track of it in the list (sometimes the file gets renamed, sometimes not, based on the flag)
–the script should still be able to keep track of that file to perform other tasks (like opening it in Photoshop or a text editor)…so I’m assuming it’s tracking it by a reference somehow.
I’d post my script, but it’s part of a larger script that is under refinement. I’m trying to get some tips/pointers/ideas on list handling, especially when you change the name of a file mid-stream. Right now I cheat…I save the renames for last. Since I never have to deal with that list entry after the rename, it’s a moot point. But this causes me to write other parts of the script rather awkwardly and have extra information tagging along longer than it needs to. I’d like to be able to rename the file yet still be able to blissfully loop through the list of file paths without issue.
The other issue is that the rename should not cause issues with routines running operations in duplicate. For example, if the file is named AAA.pdf and gets renamed ZZZ.pdf, I need to make sure that as the loop progresses that the script doesn’t run on ZZZ.pdf since it’s been renamed.
Hopefully that makes sense…