applescript - repeat if exists document x

Jim Sims sims at ezpzapps.com
Thu Mar 12 07:10:43 EDT 2009


Works slick for Keynote.

A current issue I'm up against has been getting all this to also work  
with Preview.app, for some reason Preview seems to not play well with  
applescript. Seems that System Events has a better shot at my goal.

So, I changed direction a bit and am now going with:

tell application "System Events"
	get name of every window of application process "Preview"
end tell
return the result

Doing the above seems to require enabling access for assistive  
devices, but that is not a problem.

Thanks Bernd


On Mar 12, 2009, at 11:55 AM, BNig wrote:
> tell application "Keynote"
> 	set docsPathes to the path of every slideshow
> 	set PathOutput to ""
> 	repeat with echItm in docsPathes
> 		set PathOutput to PathOutput & echItm & return as string
> 	end repeat
>        -- take out the last return
> 	set PathOutput to characters 1 through -2 of PathOutput as string
> 	return PathOutput
> end tell
>
> a return delimited list of the pathes, if a slideshow is open which  
> is not
> saved yet it returns missing value. on system 10.5.6 it returns the  
> posix
> form of the pathes (/xxx/xxx), older versions might return the mac- 
> style
> (xxx:xxx)
> To return mulitple lists to Rev you can concatenate them into one  
> list and
> take them apart on the rev side or do multiple applescript calls.



More information about the use-livecode mailing list