Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 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:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.