• 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
Re: How to repeat forever
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to repeat forever


  • Subject: Re: How to repeat forever
  • From: Paul Berkowitz <email@hidden>
  • Date: Sun, 14 Dec 2003 20:38:57 -0800

On 12/14/03 8:21 PM, "Jim Witte" <email@hidden> wrote:

> How do I make a loop repeat forever, until I exit it? Here's my
> script:

Read the AppleScript Language Guide. You'll fin there's a 'repeat' form that
doesn't quire 'times', 'until', 'while', 'with', or anything else.
>
> set i to 1
> repeat 5 times
> set celladdr to "R" & i & "C" & 1
> set i to i + 1 -- add 1 to i
> tell application "Excel"
> Select Range celladdr
> CopyObject Selection
> set tname to the clipboard
> end tell
> display dialog tname
> --if tname is empty then exit repeat
> if (tname is "") then exit repeat
> end repeat


set i to 1
repeat
set celladdr to "R" & i & "C1"
set i to i + 1 -- add 1 to i
tell application "Excel"
Select Range celladdr
CopyObject Selection
set tname to the clipboard
end tell
display dialog tname
if tname is "" then exit repeat
end repeat
>

Why are you doing all that selecting anyway?

tell application "Excel" to set theValue to Value of Cell celladdr
if theValue = 0 then exit repeat

> (You can tell I come from the Hypertalk tradition -- I'm annoyed that
> AS isn't *exactly* like HC - Apple *does* have the code after all, and
> I'd bet there are a heck of a lot of HC scripters still out there..)

Just read the ASLG to see what you can do in AppleScript, which is where you
are now.
>
> I assume Apple isn't going to release information on how to write a
> new dialect, so that a "Hypertalk" (or Transcript, for Revolution fans)
> dialect could be written? (Myself, I think a Scheme dialect would be
> cool, but..)

Just read the ASLG. (Or the new O'Reilly's "AppleScript - The Definitive
Guide" by Matt Neuberg. But that's not free, and the ASLG is.)

--
Paul Berkowitz
_______________________________________________
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.

References: 
 >How to repeat forever (From: Jim Witte <email@hidden>)

  • Prev by Date: Errors on Apple Applescript website
  • Next by Date: Re: How to repeat forever
  • Previous by thread: Re: How to repeat forever
  • Next by thread: Re: How to repeat forever
  • Index(es):
    • Date
    • Thread