Re: Odd or even numbers
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