Trouble building app in Applescript Studio.
Trouble building app in Applescript Studio.
- Subject: Trouble building app in Applescript Studio.
- From: montana <email@hidden>
- Date: Fri, 31 Jan 2003 16:45:33 -0600 (CST)
I'm trying to build a simple date calculator in AppleScript Studio. This app take two dates from a text box and displays their difference in a third textbox. Here is the script code:
on clicked theObject
tell window of theObject
set startDate to date (contents of text field "startDate")
set endDate to date (contents of text field "endDate")
set diff to endDate - startDate
set hoursdiff to diff div hours
set secsLO to diff mod hours
set minsdiff to secsLO div minutes
-- set timeDiff to hoursdiff & ":" & minsdiff
set contents of text field "answ" to hoursdiff & ":" & minsdiff as text
end tell
end clicked
on should quit after last window closed theObject
return true
end should quit after last window closed
The app builds and runs but when I hit return to get the difference value I get the following error:
AppleScript Error
NSCannotCreateScriptCommandError (10)
Any ideas what I am doing wrong here?
Thanks.
SA
:)
_______________________________________________
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.