• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Trouble building app in Applescript Studio.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: 9.2.2 Delete everything in folder except for these items?
  • Next by Date: Re: Creating PDFs with Ghostscript
  • Previous by thread: iTunes visuals
  • Next by thread: Why are compiled scripts slower than from Script Editor?
  • Index(es):
    • Date
    • Thread