• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Check if a window named "Save" exists in a particular application.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Check if a window named "Save" exists in a particular application. (From: Timothy Devine <email@hidden>)

  • Prev by Date: Re: Filemaker 8.5 stored applescript problem
  • Next by Date: Re: Determine whether spot color is RGB or CMYK in Illustrator CS2
  • Previous by thread: Check if a window named "Save" exists in a particular application.
  • Next by thread: RE: Check if a window named "Save" exists in a particular application.
  • Index(es):
    • Date
    • Thread