Skip to main content
Inspiring
June 30, 2020
Answered

Can an Action close a file without saving - or asking permission ???

  • June 30, 2020
  • 3 replies
  • 3536 views

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

 

Correct answer CarlosCanto

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

 

3 replies

Inspiring
June 30, 2020

Thanks, Carlos. I'll try that and report back.

Cheers, and stay safe,

Allen

 

PrepressPro1
Legend
June 30, 2020

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. 

Inspiring
June 30, 2020

Thanks, PrepressPro1 -- I'll try that. Maybe Cmd/Ctrl-W works differently than using File | Close in the menu.

 

Allen

 

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
June 30, 2020

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

 

Inspiring
July 1, 2020

Worked like a charm.

Thanks!