Skip to main content
Inspiring
October 3, 2018
Question

run vbscript through javascript in illustrator

  • October 3, 2018
  • 2 replies
  • 2080 views

Hi,

     How to run vbscript via javascript with illustrator.

     app.doScript() in illustrator for only executes actions. not script file like in indesign..

      is there any other way to run vbscript via extendscript

Pls help

This topic has been closed for replies.

2 replies

Silly-V
Legend
October 3, 2018

Hmm, (as an aside) speaking of app.doScript.. I wonder - since Illustrator does take applescript and vbscript, could it be possible to install a vbs or scpt inside the Illustrator File > Scripts menu and then record a menu item action to run it?

Of course since vbs is easily executed from jsx as pointed out by sttk3​, this is really not even an issue and taking the above approach would be completely counter-productive, but I'm curious and may one day perform my own test with the .scpt files for applescript.

Legend
October 3, 2018

Write vbscript to the file, and execute it.

var str = 'MsgBox "Hello"' ;

var vbsFile = new File(Folder.desktop + '/temp.vbs') ;

try {

  vbsFile.open('w') ;

  vbsFile.write(str) ;

} finally {

  vbsFile.close() ;

}

vbsFile.execute() ;

Inspiring
October 4, 2018

HI, thanks for your reply

I have also tried your code.. but it returns error "Object required : app"

app is illustrator application..

i have written the code for store value as script argument in vbscript

my need is return values from vbscript to javascript.. but how to do this by using this approach?

Silly-V
Legend
October 4, 2018

I am interested to know if there's a native way to do this via vbs , like its Applescript counterpart.

It's async with file execute, so you may need to write your 2nd half of the script from inside the vbs and run it, or write down a text file, etc.