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

Illustrator file menu script behaves differently

Community Beginner ,
Dec 13, 2016 Dec 13, 2016

Copy link to clipboard

Copied

Hello!

My question is about a vbscript i made and installed it in the "C:\Program Files\Adobe\Adobe Illustrator CC 2015\Presets\Scripts" folder.

the name for the script is Test.vbs and i use version CC 2015

when i run my vbscript with the file menu -> scripts -> test.vbs it appears that:

* the variable name 'Illustrator' is already taken as an object.

* wscript.quit won't work anymore: "error, could not accest this object 'wscript'"?

i can't find anything in the documentation about this things, any help or explanation would be welcome!

TOPICS
Scripting

Views

495

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
Adobe
Community Expert ,
Dec 14, 2016 Dec 14, 2016

Copy link to clipboard

Copied

Can you post the script so we can debug and where things may be going wrong?

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
Community Beginner ,
Dec 14, 2016 Dec 14, 2016

Copy link to clipboard

Copied

I will post a simple example that illustrates the problem

(test it just by opening it, then by using it from the menu in illustrator)

'variable name already taken?

illustrator = "this is a test"

msgbox illustrator

'can't quit the script?

if msgbox("want to quit?",vbyesno) = vbyes then wscript.quit

msgbox "some other code"

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
Community Expert ,
Dec 14, 2016 Dec 14, 2016

Copy link to clipboard

Copied

Did you write some code and try to declare a variable called "illustrator"? If so, i think that's a bad idea from the get go.

I apologize though if i'm just ignorant. I'm not really familiar with VBScript since i'm a mac user.

Try changing the variable declaration from "illustrator" to "testMsg" like this:

testMsg = "this is a test"

msgbox testMsg

if msgbox("want to quit",vbyesno) = vbyes then wscript.quit

msgbox "some other code"

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
Community Beginner ,
Dec 14, 2016 Dec 14, 2016

Copy link to clipboard

Copied

i actually used the name illustrator for the appref object for convenience..

changing the name would off course solve the name problem but the point is the name is already taken.

also, so are there other objects predefined to?

what are the things i can do with that illustrator object?

and: quitting the script seems impossible when run from the menu?

thanks for trying to help me williamadowling

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
Community Expert ,
Dec 14, 2016 Dec 14, 2016

Copy link to clipboard

Copied

LATEST

I think there must be a language barrier here because i'm not understanding what you mean. Likely this is just because i'm used to writing JavaScript and have no experience in VB. Perhaps someone more familiar with VB can be of more help than me.

Sorry =(

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