Article View: adobe.scripting.indesign
Article #8558Getting value from external applescript
From: Konstantin_Klein
Date: Wed, 11 Oct 2006 11:11
Date: Wed, 11 Oct 2006 11:11
33 lines
1629 bytes
1629 bytes
hi everyone,
this is my first post so please forgive me any mistakes about using this forum.
I've written a small jsx-script for ID CS2 and tried to contact other applications by embedding a external applescript. Looks like that:
//contact
//ID-CS2 script
//run the external script
myScript = app.doScript(File("/users/calvin/desktop/trackplay.scpt"), ScriptLanguage.applescriptLanguage);
//display the returned value
var mydocument = app.documents.add();
with (mydocument) {
var mypage = mydocument.pages.item(0);
with (mypage) {
var mytextFrame = textFrames.add();
mytextFrame.geometricBounds = [ "0p0", "0p0", "18p0", "18p0"];
mytextFrame.contents = myScript;
}
}
The external script looks like that:
tell application "iTunes"
get name of current track
end tell
If I run the script, then I get the answer, that "contents" expected "string,.." but recieved nothing.
The funny thing is: when I insert the applescript as a string in the doScript method, then it works...
Any help is welcome.
thx,
Konstantin
Technical Details
Message-ID:
<3bc1ef70.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,27abc8bf44513160,start X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Konstantin_Klein@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: Getting value from external applescript Message-ID: <3bc1ef70.-1@webcrossing.la2eafNXanI> Date: Wed, 11 Oct 2006 04:11:22 -0700 Lines: 38 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing