• 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 do I get a script to ask me the number of times to repeat?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I get a script to ask me the number of times to repeat?


  • Subject: Re: How do I get a script to ask me the number of times to repeat?
  • From: John Stewart <email@hidden>
  • Date: Thu, 24 Feb 2005 15:44:35 -0500

On 2/24/05 at 1:24 PM,  the entity Christopher Stone spoke thusly

>>many times it is to repeat and in what phase it is to select items. So
>>my question is what is the command I need to script to have the script
>>ask me these questions?
>
>*I* sure wouldn't use GUI scripting to do this.
>
>  set srcFl to alias "Lao-Tzu:Users:chris:Documents:Test_Folder_1:"
>  set destFl to alias "Lao-Tzu:Users:chris:Documents:Test_Folder_2:"
>  set n to text returned of (display dialog "Please enter \"n\":" default
>answer "")
>
>  tell application "Finder"
>    set fList to items of srcFl
>    repeat with ndx from 1 to count of fList by n
>      move item ndx of fList to destFl
>    end repeat
>  end tell

Chris,

After the first file is moved your index is incorrect because what was file #2 is now file #1. The next file you move will be what was file #4 and is now file #3. You need to count backwards with a negative step so your file index doesn't shift.

repeat with ndx from count of fList to 1 by -2

JBS
--
If lawyers are disbarred and clergymen defrocked, doesn't it follow that electricians can be delighted, musicians denoted, cowboys deranged, models deposed, tree surgeons debarked, and dry cleaners depressed? - George Carlin
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: How do I get a script to ask me the number of times to repeat? (From: Christopher Stone <email@hidden>)

  • Prev by Date: Quark 6 Move
  • Next by Date: Re: to disable applescript
  • Previous by thread: Re: How do I get a script to ask me the number of times to repeat?
  • Next by thread: Re: How do I get a script to ask me the number of times to repeat?
  • Index(es):
    • Date
    • Thread