Re: Repeat until ...the user chooses to stop?
Re: Repeat until ...the user chooses to stop?
- Subject: Re: Repeat until ...the user chooses to stop?
- From: Ron <email@hidden>
- Date: Mon, 26 Nov 2007 20:05:45 -0600
How about this...
set thePath to {}
tell application "Google Earth"
repeat
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"} default button "Go" giving up
after 2)
--set theTime to do shell script "date +'%m-%d-%YT%I:%M:%S'"
end tell
if response = "Stop" then exit repeat
end repeat
end tell
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