• 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: increment a variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: increment a variable


  • Subject: Re: increment a variable
  • From: "Stockly, Ed" <email@hidden>
  • Date: Thu, 03 Mar 2016 23:10:46 +0000
  • Thread-topic: increment a variable

>As I don’t know how many frames will need to be placed, the repeat loop
>takes care of placing the correct number but I’m stumped on how to assign
>the variables to them. Quite possible I’m being dense and missing
>something obvious, but I can’t figure out how to do this.

Rjay, you're not being dense or missing anything obvious. AppleScript can
be dense at times and miss obvious things.

I've had a similar issue, and my solution was when I got the number from
the user, I immediately used a repeat loop to build a list:

Set myTextFrames to {}
Repeat userProvidedNumber times
	Set the end of myTextFrames to ""
End repeat

———
myTextFrames —>> {"","","","",""}

Repeat with x from 1 to userProvidedNumber
	Set item x of myTextFrames to textFrame x
End repeat
----
So instead of

	variableNameX

you have

	item x of myTextFrames

Does that make sense?


 _______________________________________________
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


  • Follow-Ups:
    • Re: increment a variable
      • From: RJay Hansen <email@hidden>
References: 
 >increment a variable (From: RJay Hansen <email@hidden>)

  • Prev by Date: Re: increment a variable
  • Next by Date: Re: AppleScript is now deliberately annoying me to death
  • Previous by thread: Re: increment a variable
  • Next by thread: Re: increment a variable
  • Index(es):
    • Date
    • Thread