• 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: Bryan Vines <email@hidden>
  • Date: Tue, 05 May 2009 14:22:16 -0500

Jim,

Try this code. It assumes the frontmost window is the source window.
It will get the value of the checkbox.
If the value is 1, the checkbox is checked, and the code will uncheck it.
If the value is 0, the checkbox remains unchanged.


activate application "Safari"
tell application "System Events"
tell process "Safari"
set checkBoxValue to get value of checkbox "Hide extension" of sheet 1 of window 1
if checkBoxValue is 1 then click checkbox "Hide extension" of sheet 1 of window 1
end tell
end tell



-- Bryan Vines email@hidden

On May 5, 2009, at 10:23 AM, email@hidden wrote:

Date: Tue, 5 May 2009 08:39:23 -0500
From: Jim Brandt <email@hidden>
Subject: Testing a checkbox status in Safari
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

Is there a way in either System Events or in Safari to check the
status of a
checkbox on a sheet opened from a save command of the view source
window?

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?

TIA,

Jim Brandt

_______________________________________________ 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
  • Prev by Date: Re: Testing a checkbox status in Safari
  • Next by Date: Re: Testing a checkbox status in Safari
  • Previous by thread: Re: Testing a checkbox status in Safari
  • Next by thread: Re: Testing a checkbox status in Safari
  • Index(es):
    • Date
    • Thread