Article View: adobe.scripting.indesign
Article #2053[JS,AS,CS3]running javascript in bridge from applescript
From: james_hendrickx
Date: Wed, 07 Jan 2009 14:16
Date: Wed, 07 Jan 2009 14:16
35 lines
1881 bytes
1881 bytes
Sorry for the cryptic subject description, and you might think this is a bit off topic, but i hope you could shed some light on this.
I need to execute a Javascript in Bridge from an applsecript using an Applescript. Bridge only has one AS command: do javascript with arguments.
My testtude looks like this:
set myJS to "
alert(arguments[0].toString());
alert(arguments[1].toString());
alert(arguments[2].toString());
alert(arguments[3].toString());
alert(arguments[4][0].toString());
"
set arg1 to 12
set arg2 to "some text"
set arg3 to "'some single quoted text'"
set arg4 to "\"some double quoted text\""
set arg5 to {1, 2, 3, "a", "b", "c"}
tell application "Bridge CS3"
do javascript myJS with arguments {arg1, arg2, arg3, arg4, arg5}
end tell
--tell application "Adobe Photoshop CS3"
-- do javascript myJS with arguments {arg1,arg2,arg3,arg4,arg5}
--end tell
You would expect a series of dialogs to appear with the content of the arguments, but you'll get nothing! If you omit the '[0]', you'll get any numerical value, but all strings, however they are quoted, are ignored.
Strange.
Stranger still is, that if do the exact same thing in Photoshop, it works like a charm and you can pass any kind of data as argument.
Any ideas on what's going on?
Thanks!
Technical Details
Message-ID:
<59b7725f.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newshub.sdsu.edu!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,8400ccc6b1ede1f,start X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: james_hendrickx@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: [JS,AS,CS3]running javascript in bridge from applescript Message-ID: <59b7725f.-1@webcrossing.la2eafNXanI> Date: Wed, 7 Jan 2009 06:16:26 -0800 Lines: 41 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit