Re: loaded script subroutines
Re: loaded script subroutines
- Subject: Re: loaded script subroutines
- From: Michael Grant <email@hidden>
- Date: Tue, 13 Jan 2004 16:49:33 -0600
On Jan 13, 2004, at 3:47 PM, Wallace, William wrote:
--begin main script
set scriptVar1 to load script "path:to:script1"
set scriptVar2 to load script "path:to:script2"
set theData "some string or something"
tell scriptVar1 to doStuff(theData)
--end main script
--Script1
on doStuff(myData)
display dialog myData giving up after 10
tell scriptvar2 to doMoreStuff(myData)
end doStuff
--end script1
--Script2
onDoMoreStuff(myArgs)
set myString to myArgs & " meaningless"
display dialog myString
end doMoreStuff
Now, if I saved the Main script as an application and saved script1
and script2 both as compiled scripts (assuming that path:to: was a
real location where the scripts were saved to) and then ran the main
script app, I would expect to first see a dialog box with the text
"some string or something", and then a dialog box with the text "some
string or something meaningless". But it don't seem to work that way.
What am I doing wrong?
Besides leaving out the 'to' when setting the variable theData, you
never told your script 1 about script 2. You either need to pass the
variable scriptvar2 along with theData, or load script 2 within script
1.
Michael
--
I believe there's something out there watching over us. Unfortunately,
it's the government.
- Woody Allen
_______________________________________________
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.