• 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: Odd & Even Pages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Odd & Even Pages


  • Subject: Re: Odd & Even Pages
  • From: Arthur Knapp <email@hidden>
  • Date: Fri, 24 Oct 2003 15:48:20 -0400

Date: Fri, 24 Oct 2003 12:48:24 -0400
Subject: Odd & Even Pages
From: Christopher MJ Tangora <email@hidden>

I am moding the OS X applescript to rename files, but I want to add
page numbers to it. Even more specifically I am wanting to add only
even or odd page numbers. From what I have seen I will have to put in
the actual replacements manually, as in 1 = 2, 2 = 4, 3 = 6, etc. for
the evens, and just 1=2, 2=3, 3=5, etc for the odds. What I am hoping
is that someone knows a way to allow the script to only write odd or
even numbers.

I'm not quite sure what is needed, but perhaps these will help out:

repeat with odd_number from 1 to top_number by 2
odd_number --> is odd
end repeat

repeat with even_number from 2 to top_number by 2
even_number --> is even
end repeat

ie:

on AppendEvenNumbersToStrings(list_of_strings)

set list_index to 1

repeat with even_number from 2 to (2 * (length of list_of_strings)) by 2

set new_string to item list_index of list_of_strings

set new_string to new_string & even_number

set item list_index of list_of_strings to new_string

set list_index to list_index + 1

end repeat

end AppendEvenNumbersToStrings

set my_list to {"a", "b", "c", "d"}

AppendEvenNumbersToStrings(my_list)

my_list --> {"a2", "b4", "c6", "d8"}


{ Arthur J. Knapp;
<mailto:email@hidden>;

What...? Oh...!
}
_______________________________________________
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.

  • Prev by Date: Re: Odd & Even Pages
  • Next by Date: Re: Eudora AppleScript Question...
  • Previous by thread: Re: Odd & Even Pages
  • Next by thread: Re: Get IP
  • Index(es):
    • Date
    • Thread