Applescript Error: The variable result is not defined. (-2753)
Applescript Error: The variable result is not defined. (-2753)
- Subject: Applescript Error: The variable result is not defined. (-2753)
- From: Richard Covert <email@hidden>
- Date: Fri, 14 May 2004 10:42:43 -0500
I have a AS script which is built using AS Studio. It has one main
window which has a NXTextField named
statusField
it's attributes
Layout:
wraps
Options:
no checked boxes
Applescript
awake from nib checked
no other buttons checked
The problem is that when I call the handler I wrote to set the contents
of the NSTextField in my main I get an
AS error back saying that the result variable is underfined.
If I remove the 'get result' statement immediately following the 'set
contents' statement I get a different error reporting :
Applescript error:
No result was returned from some part of this expression. (-2763)
I get the same errors if I use either the 'set' or the 'copy'
statements to change the contents of
the text field.
What is the difference between setting the contents of a text field
from the 'awkare from nib' handler and a local
handler in my script?
Have I lost focus of the app?? Is the 'awake from nib' using the
"Finder" and my local handler using the script?
Why does he statement result in an error saying that part of the
expression (set contents to ...) fail to return??
Should my updateStatus handler have a tell app ???? in it ?? And if so,
then what app should it be?
CODE FOLLOWS BELOW
copy "This is a test" to the contents of text field "statusField" of
window "main" of current application
--get result
my AS script has the following layout:
script RadioShow
(* This is the Base Object. It contains the data common
to all object dealing with a radio show.
It will have the following:
HostName - derived from either thr Trim Files or from the name of the
chosen
folder.
ShowDate - derived from either thr Trim Files or from the name of the
chosen
folder.
*)
some properties defined
some handlers defined
end script
some more handlers
some more children scripts of the RadioShow script to access its
properties
on updateStatus(message)
copy "This is a test" to the contents of text field "statusField" of
window "main" of current application
get result
--display dialog "inside updateStatus handler"
--set the contents of text field "statusField" of window "main" to
message
end updateStatus
script SelectTrimFolder
-- your commands go here
property parent : RadioShow
(* actual code was removed for this example email *)
display dialog "next statement is updateStatus"
my updateStatus("Selected folder: " & my TrimFolder as string)
--display dialog "just returned from updateStatus"
-- end tell
end script
on clicked theObject
(*Add your script here.*)
--display dialog "the class of theObject is " & the class of theObject
display dialog "the name of theObject is " & the name of theObject
if the name of theObject is "PostShow" then
display dialog "Posting the show now"
end if
(* Process the buttons *)
if the name of theObject is "PostShow" then
run DoItAll
else if the name of theObject is "SelectSwitch" then
if (run SelectTrimFolder) is false then
my displayRSStuff
end if
else if the name of theObject is "JoinSwitch" then
--tell JoinEm
tell JoinEm
NormalizeTrimFiles()
CatEm()
end tell
else if the name of theObject is "RarSwitch" then
tell RadioShow
rar2()
end tell
else if the name of theObject is "ParSwitch" then
tell ParEm
run
end tell
else if the name of theObject is "PostSwitch" then
run PostEm
end if
end clicked
on awake from nib theObject
(*Add your script here.*)
set the contents of text field "statusField" of window "main" to "Just
Started"
end awake from nib
_______________________________________________
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.