• 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: Scott Babcock <email@hidden>
  • Date: Fri, 18 May 2007 14:29:06 -0700
  • Acceptlanguage: en-US
  • Thread-topic: Check if a window named "Save" exists in a particular application.

Why not use System Events to check for the existence of the window?

    tell application "System Events"
        tell application process "MaxMSP"
            set windowRef to (a reference to window "Save")
            if (exists windowRef) then
                click button "Save" of windowRef
            end if
        end tell
    end tell

What's the reference to window 0, though? This can't be right, since all AppleScript indexes are based at 1...

-----Original Message-----

Date: Fri, 18 May 2007 20:52:15 +0200
From: Timothy Devine <email@hidden>
Subject: Check if a window named "Save" exists in a particular
        application.
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset="us-ascii"

Hi all,

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

on idle
        tell application "MaxMSP"
                if (window "Save" exists) then -- THIS LINE DOES NOT WORK
                        tell application "MaxMSP"
                                activate
                        end tell

                        tell application "System Events"
                                click button "Save" of window "Save" of application process "MaxMSP"
                        end tell

                        tell application "MaxMSP"
                                activate
                        end tell

                        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


Tim Devine
_________________
Artist in Residence
State Library of Victoria
________________________
LAB.NEONGOLDEN.NET


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.apple.com/mailman/private/applescript-users/attachments/20070518/f7e5f17c/attachment.html

------------------------------

_______________________________________________
AppleScript-Users mailing list
email@hidden
http://lists.apple.com/mailman/listinfo/applescript-users

End of AppleScript-Users Digest, Vol 4, Issue 234
*************************************************
 _______________________________________________
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

  • Follow-Ups:
    • Re: Check if a window named "Save" exists in a particular application.
      • From: Chris Page <email@hidden>
  • Prev by Date: Re: Determine whether spot color is RGB or CMYK in Illustrator CS2
  • Next by Date: Re: Filemaker 8.5 stored applescript problem
  • Previous by thread: Re: 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