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

Storing a persistent variable with scripting?

Community Beginner ,
Sep 09, 2014 Sep 09, 2014

Hello --

is it possible to store the value of a variable via scripting after a script has been executed or does it only exist during runtime? The use case here would be to store a user entry between multiple executions of a script, e.g. the name of an artboard.

thanks in advance,

patrick.

TOPICS
Scripting
1.2K
Translate
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
Adobe
Community Expert ,
Sep 09, 2014 Sep 09, 2014

you "could" use global variables, they survive until you close illustrator...or more properly, write your persistent data to a text file.

Translate
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
Community Beginner ,
Sep 10, 2014 Sep 10, 2014

hello carlos --

thank you for your note and i will experiment with that. somehow i had expected that there is a way to create some data structure that would be saved with the document automatically, but couldn't find any documentation on it.

thanks,

patrick.

===

Translate
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
Valorous Hero ,
Sep 10, 2014 Sep 10, 2014

You talkin' 'bout the ol' XMP?

Translate
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
Community Expert ,
Sep 10, 2014 Sep 10, 2014

That's right, forgot about the XML string

Translate
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
Community Beginner ,
Sep 10, 2014 Sep 10, 2014

hi there --

i am not familiar with that at all, could you elaborate how this is used?

thanks in advance.

Translate
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
Community Expert ,
Sep 10, 2014 Sep 10, 2014

Hi,

Below link is sample code of manipulate XMP packets:

https://github.com/ten-A/Extend_Script_experimentals/blob/master/metaMemo.jsx

maby this help…

Ten

Translate
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
Community Beginner ,
Oct 17, 2014 Oct 17, 2014

You could also use tags.  Nice and persistent along with being easily searchable on a document level.

Translate
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 ,
Oct 19, 2014 Oct 19, 2014
LATEST

You could have a look at the script I have linked to below.

I have not used it in a while but it reads and writes to a text file.

Store as many variables as you like and would be persistent on a system restart.

qwertyfly.com/QQT.zip

Translate
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