Copy link to clipboard
Copied
Is it possible to open the top most file under "Open Recent" files, as part of an Action? But not locked to a particular file when the Action was created, but is actually the most recent file opened.
The reason I want to do this is because there seems no other way to do what I want. A couple of years ago I asked about a certain action that I need, and there was no solution, so I'll try again.
I have about 30 actions that save images in a variable format and size, e.g. jpg 1080P, or PSD 1920W (1920 wide), and so on. These files are destined for Premiere, but the original file I want to save as Tiff > Zip just before I run the relevant Action.
The problem is… Tiff > Zip can take up to a minute to save, whereas Tiff > LZW usually takes only seconds, meaning I can jump straight into Premiere to see the result, instead of waiting for the Tiff > Zip file to save.
These are the typical steps I take when using an Action:
I want to generate new Actions that, right at the end (after the jpg or whatever has been saved), that the most recent file is then opened (the same file I was working on) and automatically saved and closed as Tiff > Zip. i.e. it runs in the background while I'm inside Premiere looking for the next file to edit.
My Actions can be downloaded here. It's only the ones starting with "Crop" that I'm talking about. To see how they work, you have to have a selection in place before the Action is run.
Thanks in advance for any suggestions.
The following "action helper script" will open the most recent file. It can be recorded into an action as a step.
#target photoshop
if (app.recentFiles.length > 0) {
try {
app.open(File(app.recentFiles[0]));
} catch (e) {
//alert("The file is missing or an unexpected error occurred!"
}
} else {
//alert("The Open Recent list is empty!");
}
Copy link to clipboard
Copied
The following "action helper script" will open the most recent file. It can be recorded into an action as a step.
#target photoshop
if (app.recentFiles.length > 0) {
try {
app.open(File(app.recentFiles[0]));
} catch (e) {
//alert("The file is missing or an unexpected error occurred!"
}
} else {
//alert("The Open Recent list is empty!");
}
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I only just saw your reply. I wasn't notified by email, or the email went to spam.
I entered the script into Apple Script, but I'm not allowed to Save, Run, or Compile it (see attachment). I know very little about scripting, but if it can be fixed, let me know and I'll try it. Over the next 18 months I expect to run the Actions several thousand times, so the script would be a great help.
A Concern
One thing I'm concerned about is the "opening the most recent file" thing. My wording was unclear. I may have several files open in PS, and the one I'm actually about to run the Action on, may not be the most recent file that I opened. The Action has to re-open the same file that it started on.
To reword my original post:
I want to generate new Actions that, right at the end (after the jpg or whatever has been saved), that the same Tiff file I was just working on (and that I just saved) is automatically opened again, saved as Tiff > Zip, and closed. i.e. it runs in the background, while I go inside Premiere to look at the result.
Another concern
Thinking more about this, what I want may not be desirable in an Action because I'll be locked out of doing anything else in PS while the file is re-saved as Tiff > Zip. That could take a minute.
Me smarter than computer!
How come this flash computer I've got, can't automatically do what I can easily do manually:
Anyway, if you can think of a method, please respond.
Copy link to clipboard
Copied
I entered the script into Apple Script, but I'm not allowed to Save, Run, or Compile it (see attachment). I know very little about scripting, but if it can be fixed, let me know and I'll try it.
By @Guy Burns
The code is not AppleScript code, it's ExtendScript/JavaScript.
Only paste the source code into plain text editors, not rich text or word processing apps. If using Apple TextEdit.app, ensure the Format menu is set to Plain Text mode, not Rich Text mode.
Scripts are installed in the /Presets/Scripts folder
Mac OS Example:
Copy link to clipboard
Copied
A Concern
One thing I'm concerned about is the "opening the most recent file" thing. My wording was unclear. I may have several files open in PS, and the one I'm actually about to run the Action on, may not be the most recent file that I opened. The Action has to re-open the same file that it started on.
To reword my original post:
I want to generate new Actions that, right at the end (after the jpg or whatever has been saved), that the same Tiff file I was just working on (and that I just saved) is automatically opened again, saved as Tiff > Zip, and closed. i.e. it runs in the background, while I go inside Premiere to look at the result.
By @Guy Burns
Then the previously posted script may not suit this new criteria.
So are you using Save As and not Save a Copy?
Copy link to clipboard
Copied
In all my Actions, under the "Save" step it says:
as: JPEG
in: A-Data:Slide Temp:
With Copy
I'll try the script and see how it goes. I can alter my workflow to only work on one file at a time – I think.
Copy link to clipboard
Copied
If you can clearly and concisely explain your process step by step, I'm sure that a new script can be written.
Copy link to clipboard
Copied
I've just put your script through its paces on a test file, and it works. Placed at the end of my Actions that crop and save to other formats, it causes PS to revert to the Tiff file at the head of the "Recent Files" list.
Now I'll put it through some real life tests over the coming weeks. Instead of my previous method of…
I can now Save As when the Action finishes, and choose Tiff Zip.
Ques: Is there any way to automate that last step, the save as Tiff Zip? – but in a way that does not lock up PS.
Copy link to clipboard
Copied
Saving the master file without closing then doing something else and then reverting might be an option over closing and reopening.
Copy link to clipboard
Copied
Ques: Is there any way to automate that last step, the save as Tiff Zip? – but in a way that does not lock up PS.
By @Guy Burns
When I previously tested actions and scripted saves, they always saved in the foreground. It appears that background saving is only triggered by user input.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now