applescript - repeat if exists document x
Jim Sims
sims at ezpzapps.com
Wed Mar 11 16:13:44 EDT 2009
I'm trying to get a count of open photoshop image files. They do not
show up using terminal and lsof. Therefore I am undergoing an exercise
that always reinforces how much I like using Rev - using
applescript. :-P
The following result will tell me how many image files are open in
"Photoshop Elements 4.0"
My problem is that it looks for a set number of times (30) and then
tells me the count.
I would like to have it not perform the repeat with a set number (as
in 30) but to count until it knows that it got them all. IOW so it
quits repeating after a counter of N if there are N files open. Hope
I'm making sense here :-/
Any applescript Gurus out there?
set z to 0
set x to 0
repeat 30 times
tell application "Photoshop Elements 4.0"
set x to x + 1
if exists document x then set z to z + 1
set counter to z
end tell
end repeat
return counter
sims
sims at ezpzapps.com
Skype: sims.jim
iChat: techietours
______________________
Opportunity by Design
More information about the use-livecode
mailing list