Highlighted

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

Engaged ,
Jun 30, 2020

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

 

Adobe Community Professional
Correct answer by CarlosCanto | Adobe Community Professional

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

 

TOPICS
How to, Tools

Views

157

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

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

Engaged ,
Jun 30, 2020

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

 

Adobe Community Professional
Correct answer by CarlosCanto | Adobe Community Professional

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

 

TOPICS
How to, Tools

Views

158

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 30, 2020 0
Adobe Community Professional ,
Jun 30, 2020

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

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 30, 2020 1
Engaged ,
Jun 30, 2020

Copy link to clipboard

Copied

Worked like a charm.

Thanks!

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 30, 2020 0
Advisor ,
Jun 30, 2020

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. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 30, 2020 0
Engaged ,
Jun 30, 2020

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

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 30, 2020 0
Engaged ,
Jun 30, 2020

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.

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 30, 2020 0
Engaged ,
Jun 30, 2020

Copy link to clipboard

Copied

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

Cheers, and stay safe,

Allen

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 30, 2020 0