• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Purging Undo Cache

Participant ,
Mar 23, 2023 Mar 23, 2023

Copy link to clipboard

Copied

Hi,

Is it possible to purge the Undo Cache via Script or SDK? I'm dealing with quite heavy files, duplicating, moving around, making clipping masks etc. 32GB Ram fills up and crashes some documents. I'm confident that it's the undos that's eating the Ram because twice as much Ram is being used when I change from 50 to 100 Undos in the settings.

 

Thanks!

(I posted a version of this about 5 years ago, but didn't get a definite answer back then.)

TOPICS
Scripting , SDK

Views

573

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
community guidelines

correct answers 2 Correct answers

Guide , Mar 23, 2023 Mar 23, 2023

You can purge it with the SDK for sure, I've done it. From AIUndo.h:

	/**	Forgets all redoable transactions.
		Any redos available at this point are forgotten.
		This decreases the available redo transactions to 0.
		@param document The document on which to perform the operation..
	 */
	AIAPI AIErr (*ForgetRedos) ( AIDocumentHandle document );

	/**	Forgets all future transactions and commits all
		current and past transactions. Post this the transaction
		queue is empty.  */
	AIAPI AIErr (*Clear
...

Votes

Translate

Translate
Participant , Mar 23, 2023 Mar 23, 2023

Thank you! Got the "newest" SDK to work and with that also the ClearHistory and ForgetRedos so it's all good now. In my "old" 2020 SDK reference manual those functions are omitted. They also got red-lined in my IDE. weird.

Votes

Translate

Translate
Adobe
Guide ,
Mar 23, 2023 Mar 23, 2023

Copy link to clipboard

Copied

You can purge it with the SDK for sure, I've done it. From AIUndo.h:

	/**	Forgets all redoable transactions.
		Any redos available at this point are forgotten.
		This decreases the available redo transactions to 0.
		@param document The document on which to perform the operation..
	 */
	AIAPI AIErr (*ForgetRedos) ( AIDocumentHandle document );

	/**	Forgets all future transactions and commits all
		current and past transactions. Post this the transaction
		queue is empty.  */
	AIAPI AIErr (*ClearHistory) ( AIDocumentHandle document );

 

Votes

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
community guidelines
Participant ,
Mar 23, 2023 Mar 23, 2023

Copy link to clipboard

Copied

Awesome!, I didn't find it in my manual since I'm stuck with the 2020 SDK. Theese functions seem to be brand new. Going to try to get the Newer SDK to run, I'm eager to try this.

Votes

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
community guidelines
Guide ,
Mar 23, 2023 Mar 23, 2023

Copy link to clipboard

Copied

It's been there going back at least 15 years, but I just checked and apparently they changed the API at some point. In CS6, it was:

 

AIAPI AIErr (*PurgeAllUndos) ( void );

 

But in CS6, it was marked as deprecated, so I guess they eventually replaced it with ClearHistory().

Votes

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
community guidelines
Participant ,
Mar 23, 2023 Mar 23, 2023

Copy link to clipboard

Copied

Thank you! Got the "newest" SDK to work and with that also the ClearHistory and ForgetRedos so it's all good now. In my "old" 2020 SDK reference manual those functions are omitted. They also got red-lined in my IDE. weird.

Votes

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
community guidelines
Guide ,
Mar 23, 2023 Mar 23, 2023

Copy link to clipboard

Copied

LATEST

Huh, you're right: none of them are in v24. So there must have been a few releases without anything. Funny! Good thing I never needed it! And good thing you can use it now 😁

Votes

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
community guidelines