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

Scripts in actions with no open documents

Community Expert ,
Oct 31, 2017 Oct 31, 2017

hello all,

 

Might be rather a niche question but hopefully someone's in the same boat. I use a script every day that opens an AI file and embeds JPEGs in it, so i was rather hopeful that when Adobe announced they'd fixed the bug involving scripts in actions surviving restarts I'd be able to use an f-key for this.

 

when i access the script from the file menu it doesn't matter if any files are open or none, the script runs as expected. however, recorded as an action (with Insert Menu Item) I get the message:

 

'The object "ScriptName" is not currently available.'

 

unless there is already an open document.

 

Does anyone use this method to run scripts that either open documents or otherwise shouldn't require an open document? Have they worked or generated errors?

 

edit: uservoice link. Please visit and vote if you also have this issue:

 

https://illustrator.uservoice.com/forums/601447-illustrator-bugs/suggestions/32234404-playing-script...

TOPICS
Scripting
1.6K
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
Valorous Hero ,
Oct 31, 2017 Oct 31, 2017

Does it do this any time there is no open document, or just before you open the first document after a restart?

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 ,
Oct 31, 2017 Oct 31, 2017

any time. i open a doc (or start a new one), it runs. I close all open docs, no go.

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 ,
Oct 31, 2017 Oct 31, 2017

How unfortunate. A good find. I guess the only thing to try at this time would be to incorporate opening a particular file with your action and see if this lets you run the script following that. At least with script you can logically tell that this is your designated dummy file and therefore it can be ignored or closed.

While completely not the same, this does remind me of MS Office products where their macros actually live inside documents, and to have a collection of macros you've got to have a special workbook always open in Excel which contains the code.

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
Mentor ,
Oct 31, 2017 Oct 31, 2017

can you set your action to create a blank document before it runs the script? then close that document at the end?

not exactly ideal, but it may work.

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 ,
Nov 13, 2017 Nov 13, 2017

Thanks chaps. that would be a workaround, but it's not worth the trouble right now. i reported it on uservoice, please vote if you're at all interested:

Playing scripts via action with no open documents – Adobe Illustrator Feedback

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
Explorer ,
Sep 18, 2019 Sep 18, 2019

I'm having this problem as well.

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 18, 2019 Sep 18, 2019
Did you visit the uservoice link I posted above and vote?
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
Explorer ,
Sep 19, 2019 Sep 19, 2019
Yup I sure did 🙂
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 19, 2019 Sep 19, 2019
I'm afraid with only two votes this one may be at the back of the queue.
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
Explorer ,
Sep 26, 2019 Sep 26, 2019
LATEST
I know, it really sucks. That's why I've just caved in and I have my action opening a new doc before running script every time. I have to close new doc manually cuz i can't figure out how to close it with action or script instead of closing the template I had the script open.
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