Re: Check if a window named "Save" exists in a particular application.
Re: Check if a window named "Save" exists in a particular application.
- Subject: Re: Check if a window named "Save" exists in a particular application.
- From: Michelle Steiner <email@hidden>
- Date: Fri, 18 May 2007 12:29:57 -0700
On May 18, 2007, at 11:52 AM, Timothy Devine wrote:
I am trying to create an apple script to check if a window with the
name "Save" exists in a particular application. If the "Save"
window appears it will 'save' and 'replace' the file in a
particular folder. I am assuming i will use GUI scripting. this is
what i have so far. Thanks for any ideas in advance. tim
My first suggestion is to try it without the "on idle" wrapper.
on idle
tell application "MaxMSP"
if (window "Save" exists) then -- THIS LINE DOES NOT WORK
Is the application scriptable? If it doesn't have a dictionary or if
the dictionary doesn't include the Window class, that would explain
the failure.
tell application "MaxMSP"
activate
end tell
You don't need the nested tell block here; just "activate" will do.
tell application "System Events"
click button "Save" of window "Save" of application process
"MaxMSP"
end tell
tell application "MaxMSP"
activate
end tell
Ditto the nested tell; you may not need the activate command either.
tell application "System Events"
click button "Replace" of window 0 of application process "MaxMSP"
end tell
end if
end tell
return 5 -- do this every 5 seconds
end idle
-- Michelle
--
"Beware the march of ideas."
_______________________________________________
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/archives/applescript-users
This email sent to email@hidden