loaded script subroutines
loaded script subroutines
- Subject: loaded script subroutines
- From: "Wallace, William" <email@hidden>
- Date: Tue, 13 Jan 2004 15:47:11 -0600
- Thread-topic: applescript-users digest, Vol 3 #2330 - 13 msgs
Okay, here's what I've done:
I have a script which loads several other scripts containing handlers for various tasks. When I test these scripts in isolation from each other they work fine. But when they're all loaded into the same script, there are times when they need to call each other and then the errors start flying (usually a -2753 the variable <yada yada> is not defined). For instance:
--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?
B!ll
PS - as always, I'm using MacOS 9.2.2 and AS 1.8.3
_______________________________________________
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.