Re: Call javascript not working!
Re: Call javascript not working!
- Subject: Re: Call javascript not working!
- From: "Arthur J. Knapp" <email@hidden>
- Date: Thu, 29 Aug 2002 15:04:02 -0400
>
Date: Thu, 29 Aug 2002 15:58:03 +0100
>
Subject: Call javascript not working!
>
From: Michael Tompsett <email@hidden>
>
Javascript works fine when called from applescript when it does not have the
>
FUNCTION wrapper and xx and yy are replaced by actual numbers.
>
>
When it is called with the function wrapper it does not work, and
>
applescript reports 3undefined2.
But you aren't actually calling the function, you are just defining it.
According to the documentation that I just downloaded from Adobe, the
"with arguments" parameter of "do javascript" creates a global array in
the script called arguments[]. You need to directly access this array.
>
tell application "Adobe Photoshop 7.0"
>
activate
>
do javascript (file "macintosh HD:desktop folder:move.js") with
>
arguments {-10,-10}
>
end tell
>
Javascript below:
// define the function:
function move ( xx, yy )
{
var id152 = charIDToTypeID( "Trnf" );
[snip]
}
// call the function, with the arguments:
move( arguments[0], arguments[1] );
// end file
{ Arthur J. Knapp, of <
http://www.STELLARViSIONs.com>
a r t h u r @ s t e l l a r v i s i o n s . c o m
}
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.