Copy link to clipboard
Copied
I'm using an Action in a Batch operation. The procedure opens each AI file in an Input folder, one at a time, and writes a specific size JPG into an Output folder.
Since the AI files aren't being changed, I don't need or want to save them. (I'd prefer not to, in order to preserve their last edit timestamp.)
But the Action script can't close a file without saving! So I have to choose NO for every file in the batch. I tried inserting a Revert command before the Save, but Revert also asks for permission. (Yes, the Action is being run without the dialog option enabled.)
Is there a way for an Action to close a file without saving or asking permission? Having to grant permission for each file, from a folder that might contain hundreds of files, defeats some of the convenience of a Batched Action.
Thanks in advance,
Allen
there's a flag that tells the application the document needs saving. We can turn that flag off with this script
// turn edited flag off
activeDocument.saved = true;
- place the script in the scripts folder
- restart illustrator
- record an action to run the script
- insert the action right before closing the document in you existing action set
- batch as usual
let me know if it works for you.
thanks
Carlos
Copy link to clipboard
Copied
there's a flag that tells the application the document needs saving. We can turn that flag off with this script
// turn edited flag off
activeDocument.saved = true;
- place the script in the scripts folder
- restart illustrator
- record an action to run the script
- insert the action right before closing the document in you existing action set
- batch as usual
let me know if it works for you.
thanks
Carlos
Copy link to clipboard
Copied
Worked like a charm.
Thanks!
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi Carlos,
I copy and pasted the command into TextEdit and saved as rich text and converted to JSX.
When I try to run this script, I get a syntax error. Could you help me out with this?
I am trying to run a batch export of AI to PNG but when I do, it starts saving the AI file with the PNG file in the specified folder.
Copy link to clipboard
Copied
Hi Carlos,
I copy and pasted the command into TextEdit and saved as rich text and converted to JSX.
By @Evan5C9D
you need to save the jsx file as Plain Text, not Rich Text
Copy link to clipboard
Copied
I tried this with a simple export .jpg action and then while recording the action hit Command+W to record the Close action. Stopped recording of the action and ran the action. This worked for me. Make sure to try Button Mode and asigning key commands to actions.
Copy link to clipboard
Copied
Thanks, PrepressPro1 -- I'll try that. Maybe Cmd/Ctrl-W works differently than using File | Close in the menu.
Allen
Copy link to clipboard
Copied
Didn't work for me. Even if I record the action and use Ctrl-W to close the file, selecting "don't save" from the save dialog, the dialog appears whenever the action runs. Perhaps it behaves differently on Windows, and/or with .ai files.
Copy link to clipboard
Copied
Thanks, Carlos. I'll try that and report back.
Cheers, and stay safe,
Allen
Find more inspiration, events, and resources on the new Adobe Community
Explore Now