Skip navigation
Currently Being Moderated

app.doScript is not a function

Sep 28, 2011 5:52 AM

CS5, Win7/64

 

Hello,

executing/debugging following test script:

#target Photoshop
var myVbScript = 'msgbox("hello world")';
app.doScript(myVbScript, ScriptLanguage.visualBasic);

 

... produces this error message:

app.doScript is not a function

 

Executing a VBS file only with the line msgbox("hello world") works.

 

 

What's wrong with my script (or my environment)?

 

Thanks

Carlos

 

http://h6.abload.de/img/shot_11-09-28_001p71k.jpg

 
Replies
  • Currently Being Moderated
    Sep 28, 2011 6:06 AM   in reply to cmeira

    Uh...

     

    doScript is not a function (in Photoshop).

     

    The error message says it all...

     

    Harbs

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 28, 2011 7:01 AM   in reply to cmeira

    That's right.

     

    Are you using the CS SDK or ExtendScript?

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 28, 2011 7:03 AM   in reply to cmeira

    I think app.doScript is an InDesign function, I do not know of an equivalent function in Photshop that allows you to execute a VBScript script from ExtendScript (though there may be an equivalent function, I haven't done much Photshop scripting).

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 28, 2011 7:28 AM   in reply to lomorgan

    Running Applescript or VB from PS or Illy is a bit of a challenge.

     

    There is no doScript equivalent.

     

    Fo JS, you can use eval() or evalScript.

     

    For AppleScript or VB you can use file.execute() if it's saved as an executable.

     

    In Photoshop you might be able to get what you want using app.system() to execute the code in command line as well. Search the Photoshop scripting forum for examples of using app.system(). Bridge and Photoshop are the only apps which have this method.

     

    Using the CS SDK you can do some NativeProcess magic to get the code executed from command line.

     

    HTH,

    Harbs

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 1, 2011 2:58 PM   in reply to cmeira

    app.system() is available in Photoshop too (although undocumented).

     

    Here's one example thread:

    http://forums.adobe.com/message/2866913#2866913

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points