This content has been marked as final.
Show 5 replies
-
1. Re: [AS][CS2] Working with a number of specified frames
sstanleyau Oct 26, 2008 7:44 PM (in response to myDwayneSmith)You can address "every text frame whose label begins with "Cap"."<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au> -
2. Re: [AS][CS2] Working with a number of specified frames
myDwayneSmith Oct 26, 2008 8:27 PM (in response to myDwayneSmith)Thanks for your suggestion Shane, but I need to separate Caps 01, 03, 04 from Caps 02, 04, 06, 07, 08... etc.
The way I've been doing it works I just thought there would be a shorter, more elegant way. -
3. Re: [AS][CS2] Working with a number of specified frames
Eric @ MCA Oct 27, 2008 9:59 AM (in response to myDwayneSmith)You can get all the odd/even ones with a loop like this, but it's certainly not as simple as you were hoping for. Either one of these could be turned into a function pretty easily though--the second one you could pass lists of names to and get back the list of all matching labeled items pretty easily. At least then you wouldn't have to be tinkering with the physical layer of the item. That seems like it might bite you eventually...
Matching only odd frames:
set myList to {}
repeat with i from 1 to 9
if i mod 2 = 1 then
set myList to myList & (every text frame whose label = ("Cap0" & i) as string)
end if
end repeat
Alternatively, you could use selection lists:
set selectionList to {"Cap01", "Cap02", "Cap05"}
set myList to {}
repeat with i from 1 to 9
set thisString to "Cap0" & i
if selectionList contains thisString then
set myList to myList & (every text frame whose label = thisString)
end if
end repeat -
4. Re: [AS][CS2] Working with a number of specified frames
myDwayneSmith Oct 27, 2008 5:34 PM (in response to myDwayneSmith)Thanks for your help Eric much appreciated.
I've been avoiding learning this form of scripting. But I can see that learning how to use selection lists is probably inevitable as my scripting requirements become more complex.
So much to learn. -
5. Re: [AS][CS2] Working with a number of specified frames
myDwayneSmith Oct 27, 2008 7:33 PM (in response to myDwayneSmith)This was such a basic question that I feel foolish for even asking it now...
I finally worked out the syntax I was looking for: set myCaps to {text frame "Cap01", text frame "Cap03", text frame "Cap05",... etc}
Clearly having a fried-brain day.


