• 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
Repeat until ...the user chooses to stop?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Repeat until ...the user chooses to stop?


  • Subject: Repeat until ...the user chooses to stop?
  • From: Dane Springmeyer <email@hidden>
  • Date: Mon, 26 Nov 2007 16:23:49 -0800

List:

I'm interested in approaches to this problem:

I have a repeat loop crafted to capture the geographic coordinates being viewed within Google Earth and a dialog that prompts whether to continue the repeat loop and, therefore, to continue logging coordinates.

The problem is that currently the user is required to continually click the dialog to continue.

I'd like to find a way to have the repeat loop continue until the user clicks "Stop", but while keeping the display dialog prompt as a top floating window.

Any simple ideas of how to achieve this in one applescript?

Code:

----

set response to "Go"
set thePath to {}
tell application "Google Earth"
repeat while response = "Go"
set theViewInfo to (GetViewInfo) as list
set the end of thePath to (item 2 of theViewInfo) & "," & (item 1 of theViewInfo) & "," & (item 3 of theViewInfo) & "
" as string
tell application "System Events"
set response to button returned of (display dialog "Press Go to log a GE Coordinate" buttons {"Go", "Stop"})
--set theTime to do shell script "date +'%m-%d-%YT%I:%M:%S'"
end tell
end repeat
end tell

thePath

------


Thanks,

Dane

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Problem with osascript command (From: Mike Kobb <email@hidden>)

  • Prev by Date: Re: filemaker AS help
  • Next by Date: Re: Repeat until ...the user chooses to stop?
  • Previous by thread: Re: Problem with osascript command -- clarification
  • Next by thread: Re: Problem with osascript command
  • Index(es):
    • Date
    • Thread