• 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: AppleScript System Events help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript System Events help


  • Subject: Re: AppleScript System Events help
  • From: Denny Davis <email@hidden>
  • Date: Thu, 11 Feb 2016 21:03:45 -0800

this is the old script with a new Subroutine that I am trying to get working again.

on run {input, parameters}
if my GUIScripting_status() is false then error number -128
set input to input as string
set this_amount to ""
repeat with i from 1 to the length of input
set this_character to character i of input
-- convert commas to periods
if this_character is in {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "."} then
set this_amount to this_amount & this_character
end if
end repeat
if this_amount is not "" then
tell application "Calculator"
activate
end tell
tell application "System Events"
tell process "Calculator"
keystroke this_amount
delay 0.5
click menu item "Currency…" of menu 1 of menu bar item "Convert" of menu bar 1
end tell
end tell
end if

return input
end run

Christopher Stone provided this new Subroutine which takes one to the proper Preference Pane.

on GUIScripting_status()
  # Check to see if assistive devices is enabled
  tell application "System Events" to set UI_enabled to UI elements enabled
  if not UI_enabled then
    tell application "System Preferences"
      activate
      set current pane to pane id "com.apple.preference.security"
      tell pane id "com.apple.preference.security"
        reveal anchor "Privacy_Accessibility"
      end tell
    end tell
  end if
  return UI_enabled
end GUIScripting_status

GUIScripting_status()

<<<+=+=+=>>>


Basic Problem is when I get to the proper Preference Pane, 
which is System Preferences -> Security & Privacy -> Accessibility.
Then it has a list box and it says Allow the apps below to control your computer.

Well what app does one allow to control the computer?

From what the code says “System Events”, but there is no such App on my iMac.

It is not obvious and I am wondering if there is a solution, I was hoping that someone with extensive knowledge of AppleScripts might be able to answer the question of what app I can set assuming that there is one.
 _______________________________________________
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: AppleScript System Events help
      • From: Christopher Stone <email@hidden>
    • Re: AppleScript System Events help
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: AppleScript System Events help
  • Next by Date: Re: AppleScript System Events help
  • Previous by thread: Re: AppleScript System Events help
  • Next by thread: Re: AppleScript System Events help
  • Index(es):
    • Date
    • Thread