• 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: Testing a checkbox status in Safari
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Testing a checkbox status in Safari


  • Subject: Re: Testing a checkbox status in Safari
  • From: David Marshall <email@hidden>
  • Date: Tue, 5 May 2009 17:25:00 -0400

On Tue, 5 May 2009 08:39:23 -0500, Jim Brandt wrote:

This code:

    tell application "System Events"
        tell process "Safari"
            set nm to name of front window
            click checkbox "Hide Extension" of sheet 1 of window nm
        end tell
    end tell

toggles the checkbox.

I want to do this ONLY if the checkbox is not already checked,
otherwise I'm
unchecking it. So, is there a way to test it first?

instead of

click checkbox "Hide Extension" of sheet 1 of window nm

you could say (all in one line!)

if value of checkbox "Hide Extension" of sheet 1 of window nm is 0 then click checkbox "Hide Extension" of sheet 1 of window nm

- - - - -

Dave


_______________________________________________ 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:
    • CURL+FTP scripting
      • From: Satyam Satyanarayana <email@hidden>
    • Scripting MSWord
      • From: "Sutapalli Satyanarayana" <email@hidden>
  • Prev by Date: Re: Testing a checkbox status in Safari
  • Next by Date: Re: Styled text and non-Gregorian dates
  • Previous by thread: Re: Testing a checkbox status in Safari
  • Next by thread: Scripting MSWord
  • Index(es):
    • Date
    • Thread