腋下出汗有异味是什么原因| sheet是什么意思| 什么是贫血| 伏天是什么时候| 高压和低压差值在什么范围正常| 欲钱看正月初一是什么生肖| 黄柏泡水喝有什么功效| pas是什么意思| 神经内科主要看什么| 气虚吃什么中成药| 什么人一年只工作一天脑筋急转弯| 车票改签是什么意思| 营养师属于什么专业| 琳五行属什么| 头很容易出汗什么原因| 华伦天奴属于什么档次| 南瓜不能和什么同吃| 吹空调头疼是什么原因| 舌苔发黄什么原因| 金蝉花是什么| bmr是什么意思| 红润润的什么| 幻听是什么原因引起的| 最机灵的动物是什么生肖| 桂枝茯苓丸主治什么病| 28岁属什么生肖| 红枣桂圆泡水喝有什么好处和坏处| 开颌是什么意思| 红曲红是什么| 脓肿是什么病| 小孩荨麻疹吃什么药| 什么之心路人皆知| 大惊小怪是什么意思| 洒水车的音乐是什么歌| 脾胃湿热吃什么药| 心律不齐吃什么药效果好| 啪啪啪什么感觉| 秦始皇的母亲叫什么名字| 40min是什么意思| 海纳百川是什么意思| 颈椎看什么科| 遗传物质是什么| 梦见生孩子是什么意思| 牙齿突然出血是什么原因| 大虾不能和什么一起吃| 乜是什么意思| 切除扁桃体有什么好处和坏处| 婴儿第一次理发有什么讲究吗| 意中人是什么意思| 坎是什么意思| 口腔炎吃什么药| 上海曙光医院擅长什么| 上午12点是什么时候| 扁平疣是什么原因造成的| 男鼠配什么生肖最好| 年岁是什么意思| 不孝有三无后为大是什么意思| 为什么会得结石| 4.20是什么星座| 本科专科有什么区别| 什么人不宜喝咖啡| 东坡肉属于什么菜系| 豺是什么动物| 为什么经常流鼻血| 欣喜若狂的近义词是什么| 什么的落日| 白茶泡出来是什么颜色| 女人脸黄是什么原因该怎么调理| 甲亢是什么原因导致的| 非凡是什么意思| 什么样的红点是艾滋病| 脉搏高是什么原因| 渗析是什么意思| 衣食父母什么意思| 螃蟹代表什么生肖| 梦见已故朋友什么预兆| 喝豆浆有什么好处| 手肿脚肿是什么原因引起的| playboy什么意思| 为老不尊是什么意思| 吃火龙果对身体有什么好处| 电势是什么| 散光什么意思| 咽口水喉咙痛吃什么药| tin是什么| 梦见地震是什么意思| 2002年出生属什么| 劫伤是什么意思| 什么的天山| 干黄酱是什么酱| 备孕要注意什么| 人为什么要吃盐| 年底是什么时候| hb什么意思| 皮炎用什么药膏最有效| 满文军现在在干什么| 阳痿是什么原因造成的| 淀粉是什么| 乙脑是什么病| 陈凯歌为什么不娶倪萍| d g是什么牌子| 小周天是什么意思| 男士蛋皮痒用什么药| 为什么会得前列腺炎| 二甲双胍是什么药| 口下面一个巴念什么| 存款准备金率是什么意思| 权志龙为什么这么火| 甘心的近义词是什么| 贫血吃什么补血效果最好| 渴望是什么意思| 生活防水是什么意思| 糖尿病能吃什么水果| 手上长疣是什么原因造成的| 儿童头晕挂什么科| 小孩咳嗽喝什么药| 1600年是什么朝代| 水泡长什么样| 不完全骨折是什么意思| 马牛羊鸡犬豕中的豕指的是什么| 佛心果是什么东西| 不来事是什么原因| 1991年属羊的是什么命| 什么是宾格| 抗ccp抗体高说明什么| 今年23岁属什么生肖| 姜子牙为什么没有封神| 腊月初四是什么星座| 结肠多发憩室是什么意思| 精液长什么样| 清朝皇帝姓什么| 什么清肠茶好| 西柚是什么水果| 02年属什么的| 干咳嗽是什么原因| 什么是精神病| 失聪是什么意思| 又拉又吐吃什么药| 6月13日是什么星座| 10月20是什么星座| 5个月宝宝可以吃什么水果| 经期适合喝什么茶| 经常头晕是什么原因引起的| 香砂六君丸治什么病| 艾滋病潜伏期有什么症状| 流产期间吃什么好| 秋水仙碱是什么| 脑梗塞吃什么药| 脸色苍白没有血色是什么原因| 1004是什么星座| 喉咙痛吃什么| 女生喜欢什么礼物| 为什么一| 暑假让孩子学点什么好| 8.9是什么星座| 脚转筋是什么原因引起的| 泡脚去湿气用什么泡最好| 舌头两边有齿痕是什么原因| 痘痘挤出来的白色东西是什么| 吃维生素b族有什么好处| 郭敬明为什么叫小四| 智齿有什么作用| 卵巢在什么位置示意图| 总胆汁酸高说明什么| 为什么医生都不体检| 平板运动试验阳性是什么意思| 身体动不动就出汗是什么原因| earth是什么意思| 沼泽地是什么意思| 一个鸟一个衣是什么字| 搬家有什么讲究和忌讳| 小说be是什么意思| 什么无终| 比萨斜塔为什么是斜的| 色织布是什么面料| 在什么| 男人要的归属感是什么| 血色素是什么意思| 枣子什么时候成熟| 8月24是什么星座| 肾病有什么症状| 什么东西泡脚减肥| 十年婚姻是什么婚| adp是什么| 切除子宫对身体有什么伤害| 什么的街道| 解表药是什么意思| 关节咔咔响是什么原因| 刺激性干咳是什么症状| 肛瘘挂什么科| 77年属什么生肖| 男人吃什么补肾壮阳效果最好| 7.31什么星座| 毒瘾为什么那么难戒| 宫颈那囊是什么| 去澳门需要什么证件| 塔罗是什么| 喉咙有异物感是什么原因| 什么叫风热感冒| 神戳戳是什么意思| 结婚长明灯有什么讲究| 脖子长痘痘是因为什么原因| 石女是什么样子的| 婚检是什么| ar是什么意思| 山人是什么意思| 强化灶是什么意思| 同学过生日送什么礼物好| 妇炎康片主要治什么妇科病| 水瓶座后面是什么星座| 濯清涟而不妖的濯是什么意思| 属羊的和什么属相最配| 产后恶露吃什么排干净| 为什么床上有蚂蚁| 哑巴是什么原因造成的| 孕妇吃什么容易滑胎| 为什么南极比北极冷| 谷丙转氨酶偏高吃什么药| 椰土是什么| 跑单是什么意思啊| 梦见大老鼠是什么意思| 蜘蛛痣是什么样的| 戈谢病是什么病| 老人流口水是什么原因引起的| 话题是什么意思| 满五唯一的房子要交什么税| 水泡型脚气用什么药好| 尿液带血什么原因| 锦囊妙计是什么意思| 日文上下结构念什么| 句号代表什么意思| 晚上睡觉容易醒是什么原因| 尿黄起泡是什么原因| 癣用什么药| 权志龙为什么这么火| 拉肚子喝什么| a-l-岩藻糖苷酶偏高是什么原因| 湿厕纸是干什么用的| 尿发黄是什么原因| 日晡潮热是什么意思| 临床医学是干什么的| 生辰八字指什么| 蚊子爱咬什么样的人| 什么是低钠盐| 床单是什么| 胃火吃什么药| 原发性是什么意思| 九月十三是什么星座| 什么叫双飞| 咳嗽雾化用什么药| 便秘吃什么最快排便小孩| haglofs是什么牌子| 腚什么意思| 餐中服用是什么意思| 夜明砂是什么| 过敏性皮肤用什么护肤品比较好| 宫颈肥大需要注意什么| 阿斯顿马丁什么档次| 为什么腹部隐隐作痛| 三七花泡水喝有什么功效和作用| 中暑了吃什么药| o型血容易得什么病| 兔子能吃什么水果| 王字旁的字与什么有关| 百度

Graphic User Interface (GUI) Scripting

While creating scripting workflows, you may occasionally need to control applications that either do not have AppleScript support or are only partially scriptable. Mac OS X includes built-in support for the control of the computer's graphic user interface via AppleScript.

Graphic User interface (GUI) control is performed by writing scripts incorporating terms and commands from the Processes Suite in the System Events application's scripting dictionary. By addressing the System Events application, AppleScript scripts can select menu items, push buttons, enter text into text fields, and generally control the interfaces of many applications.

Activating GUI Scripting

The GUI Scripting architecture is based upon the Mac OS X Accessibility Frameworks that provide alternative methods of querying and controlling the interfaces of the OS and applications.

By default, the Accessibility Frameworks are disabled. They are enabled by clicking the checkbox labeled "Enable access for assistive devices" in the Universal Access System Preference pane:

Once the accessibility frameworks have been activated, AppleScript can be used to query and control the user interface of most applications. Scripted actions are performed by addressing the System Events application which has a special script suite for communicating with the GUI Scripting architecture.

Click to open example in the Script Editor applicationA sub-routine for checking to see if GUI Scripting support is enabled.


on GUIScripting_status()
 -- check to see if assistive devices is enabled
 tell application "System Events"
 set UI_enabled to UI elements enabled
 end tell
 if UI_enabled is false then
 tell application "System Preferences"
 activate
 set current pane to pane id "com.apple.preference.universalaccess"
 display dialog "This script utilizes the built-in Graphic User Interface Scripting architecture of Mac OS x which is currently disabled." & return & return & "You can activate GUI Scripting by selecting the checkbox \"Enable access for assistive devices\" in the Universal Access preference pane." with icon 1 buttons {"Cancel"} default button 1
 end tell
 end if
end GUIScripting_status

GUI Scripting Examples

The following script examples demonstrate the use of UI scripting to access menu items and sub-menu items:

Click to open example in the Script Editor applicationSelecting a Menu Item - A sub-routine for selecting a menu item in an application:


on do_menu(app_name, menu_name, menu_item)
 try
 -- bring the target application to the front
 tell application app_name
 activate
 end tell
 tell application "System Events"
 tell process app_name
 tell menu bar 1
 tell menu bar item menu_name
 tell menu menu_name
 click menu item menu_item
 end tell
 end tell
 end tell
 end tell
 end tell
 return true
 on error error_message
 return false
 end try
end do_menu

Click to open example in the Script Editor applicationSelecting a Sub-menu Item - A sub-routine for selecting a sub-menu item in an application


on do_submenu(app_name, menu_name, menu_item, submenu_item)
 try
 -- bring the target application to the front
 tell application app_name
 activate
 end tell
 tell application "System Events"
 tell process app_name
 tell menu bar 1
 tell menu bar item menu_name
 tell menu menu_name
 tell menu item menu_item
 tell menu menu_item
 click menu item submenu_item
 end tell
 end tell
 end tell
 end tell
 end tell
 end tell
 end tell
 return true
 on error error_message
 return false
 end try
end do_submenu

Click to open example in the Script Editor applicationA script for restarting the computer using a specified installation of Mac OS X:


property drive_identifier : "Mac OS X, 10.5.4 on Macintosh HD" -- must be exactly as it appears in pane

-- MAKE SURE SUPPORT FOR ASSISTIVE DEVICES IS ACTIVE
tell application "System Events"
 if UI elements enabled is false then
 tell application "System Preferences"
 activate
 set current pane to pane id "com.apple.preference.universalaccess"
 display dialog "This script requires access for assistive evices be enabled." & return & return & "To continue, click the OK button and enter an administrative password in the forthcoming security dialog." with icon 1
 end tell
 set UI elements enabled to true
 if UI elements enabled is false then return "user cancelled"
 delay 1
 end if
end tell
-- SWITCH TO THE DESIRED PANE
tell application "System Preferences"
 activate
 set current pane to pane id "com.apple.preference.startupdisk"
 tell application "System Events"
 tell process "System Preferences"
 -- UNLOCK CHECKS
 if (exists checkbox "Click the lock to make changes." of window 1) is true then
 click checkbox "Click the lock to make changes." of window 1
 -- wait for security login or dismissal
 repeat until (count of every window) is not 0
 delay 1
 end repeat
 if (exists checkbox "Click the lock to make changes." of window 1) then
 set perform_changes to false
 else
 set perform_changes to true
 end if
 else
 set perform_changes to true
 end if
 if perform_changes is true then
 -- MAKE CHANGES
 tell radio group 1 of scroll area 1 of group 1 of splitter group 1 of window 1
 click button drive_identifier
 end tell
 delay 1
 click button "Restart…" of window 1
 delay 1
 click button "Restart" of sheet 1 of window 1
 end if
 end tell
 end tell
end tell

荨麻疹擦什么药 牢固的近义词是什么 开诚布公什么意思 胰腺炎恢复期吃什么好 六十岁叫什么之年
普洱茶什么季节喝好 梦见抓龙虾是什么意思 消炎药吃多了有什么副作用 细菌性阴道炎吃什么药 100mg是什么意思
肌肉拉伤用什么药 美尼尔氏综合症是什么病 梦见海龟是什么意思 除湿气吃什么好 米放什么不生虫子
霍金得了什么病 什么东西比乌鸦更讨厌 冷笑话是什么意思 荷花是什么季节开放的 慢性肠炎吃什么药
心绞痛吃什么药好hcv8jop1ns1r.cn 鱼肝油又叫什么名字hcv9jop1ns8r.cn 施食是什么意思hcv8jop8ns7r.cn 女性排卵期出血是什么原因hcv8jop4ns5r.cn 今天什么属相hcv8jop5ns4r.cn
器质性病变是什么意思hcv7jop4ns8r.cn 左眼皮跳是什么原因96micro.com 鹤顶红是什么hcv9jop6ns5r.cn 菊花茶为什么会变绿色hcv8jop8ns7r.cn 内科查什么hcv8jop5ns2r.cn
不知道自己适合什么工作hcv7jop6ns2r.cn rm是什么币hcv9jop8ns0r.cn 游离是什么意思cl108k.com 胆汁酸高吃什么药hcv8jop4ns9r.cn 抽动症是什么原因造成的hcv8jop6ns8r.cn
高血压是什么病hcv8jop8ns8r.cn 后厨是做什么的hcv9jop6ns1r.cn 饸饹是什么aiwuzhiyu.com 医生为什么叫大夫creativexi.com 爱之深恨之切是什么意思hcv7jop9ns7r.cn
百度