• 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 or even numbers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Odd or even numbers


  • Subject: Re: Odd or even numbers
  • From: Stan Cleveland <email@hidden>
  • Date: Thu, 30 Nov 2006 16:11:25 -0800
  • Thread-topic: Odd or even numbers

Title: Re: Odd or even numbers
On 11/30/06 3:47 PM, Dan Doughtie wrote:

I’m trying to trigger a script in InDesign based on a page number being odd or even.
Is there a way to test if a number is odd or even.
Here is a stripped down version  

Repeat with y from 1 to mypageCount
..........
 if y is odd
Set myPage to true
Else
 set myPage to false
End if
End repeat

Odd and Even show up as some kind of accepted parameter but doesn’t act the way I thought it would.

In InDesign, those parameters (along with “all”) are used to define which pages of a document to print. What you want can be accomplished with this code:

repeat with y from 1 to mypageCount
   --
    if y mod 2 is not 0 then
       set myPage to true
   else
       set myPage to false
   end if
end
repeat

Stan C.
 _______________________________________________
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/mailman//archives/applescript-users

This email sent to email@hidden

References: 
 >Odd or even numbers (From: Dan Doughtie <email@hidden>)

  • Prev by Date: Re: Odd or even numbers
  • Next by Date: Re: Odd or even numbers
  • Previous by thread: Re: Odd or even numbers
  • Next by thread: Re: Odd or even numbers
  • Index(es):
    • Date
    • Thread