玄米是什么米| 惊闻是什么意思| 鼻孔里面痒是什么原因| 广西属于什么地区| 乳腺癌什么症状| 机电一体化学什么| 甲胎蛋白是什么指标| 合肥古代叫什么| 什么是细菌感染| 维生素b族什么时候吃效果最好| 在岸人民币和离岸人民币什么意思| 绿草如茵是什么生肖| 老是头疼是什么原因| 人心叵测是什么意思| 626是什么日子| 虾和什么食物相克| 疝气长在什么位置图片| 什么是破伤风| 飞克手表什么档次| 搬家送什么礼物最好| 酊是什么意思| 燃烧脂肪是什么感觉| 宰相和丞相有什么区别| 尿常规阳性是什么意思| 什么什么相接| 履约是什么意思| 藩台是什么官| 肠胃炎能吃什么| 吃什么提高免疫力和增强体质| 什么是凌汛| 腰椎穿刺是检查什么的| 状元郎是什么生肖| 9月21日是什么星座| 界限性脑电图是什么意思| 1936年是什么年| 臭屁什么意思| 属鼠男和什么属相最配| 什么是三伏天| 功能性子宫出血是什么原因造成的| 女生胸部长什么样| 尿潜血阳性是什么意思| 乳房胀痛吃什么药| gg是什么牌子| 国家为什么要扫黄| 老打瞌睡犯困是什么原因| 25岁属什么| 吕洞宾属什么生肖| 绝非偶然是什么意思| 物质是由什么组成的| 胃肠感冒发烧吃什么药| 减肥医院挂什么科| 小腿浮肿什么原因| 20属什么| 什么的雄鸡| 破釜沉舟的釜是什么意思| 痔疮很痒是什么原因| 嘎巴拉是什么| 为什么家里不能放假花| 圣贤是什么意思| 肛门痒是什么原因男性| 海带属于什么植物| vintage是什么牌子| 1.6号是什么星座| 借力是什么意思| 编外人员是什么意思| 72年属鼠是什么命| 3月21是什么星座| 石英机芯什么意思| 三月三号是什么星座| 量是什么意思| 神隐是什么意思| 天才是指什么生肖| 平片是什么| 治疗肺部气肿有什么方法| 左后背疼是什么原因| 爱情是什么| 老人爱睡觉什么征兆| 祸祸是什么意思| 虫草是什么| 梦见手机丢了又找到了是什么意思| 氯雷他定是什么药| 总蛋白偏低是什么意思| 刺猬是什么动物| 乌玛王是什么牌子| 者加羽念什么| 异什么同什么| 肚子疼吃什么药| 蒲公英长什么样子| 植物神经紊乱看什么科| 杜甫被称为什么| 8月26日什么星座| 5月5是什么星座| suki是什么意思| 鲜卑人是现在的什么人| 主家是什么意思| 斗牛为什么用红色的布| 背水一战是什么意思| 当医生学什么专业| 梦到孩子丢了是什么征兆| z是什么品牌| 痢疾吃什么药最有效| 吃什么药头脑立刻清醒| 查尿常规挂什么科| 山川载不动太多悲哀是什么歌| 五福临门是什么意思| 嘴苦口臭是什么原因造成的| 85年属什么生肖| 总胆固醇高是什么原因| 接盘侠什么意思| 扁桃体发炎吃什么药| 张飞穿针的歇后语是什么| 康复治疗学学什么| 香叶是什么树的叶子| 三个火读什么字| 天然气什么味道| 上挂是什么意思| 朱红色是什么颜色| abr是什么检查| 内敛是什么意思| 脚心发痒是什么原因| 女人出黄汗是什么原因| 什么火锅最好吃| 睁一只眼闭一只眼是什么意思| 舌头上火吃什么药| 什么而不什么成语| 食管裂孔疝是什么意思| 城堡是什么意思| 什么工作赚钱| 吃什么利尿最快去腹水的| 长脸适合什么眼镜框| 算筹指的是什么| 平妻是什么意思| 降钙素原是什么意思| 嘴唇挂什么科| 两个人一个且念什么| 肝外胆管扩张什么意思| 为什么光吃不拉大便| 摆谱是什么意思| 雅诗兰黛是什么档次| 男士阴囊湿疹用什么药膏| 金字旁加各念什么| 辅酶q10是什么| 血小板数目偏高是什么意思| 三白眼是什么意思| 莲蓬是什么| 肝右叶低密度灶是什么意思| 感受是什么意思| 92是什么| 彩照是什么底色| 屋漏偏逢连夜雨是什么意思| 黄体酮吃多了有什么副作用| 湿疹吃什么药好| tdi是什么意思| 孝敬是什么意思| decaf是什么意思| 清心寡欲是什么意思| 在家无聊可以做什么| 中国反导弹系统叫什么| 水痘能吃什么| 6月21号是什么日子| 一什么眉毛| 什么胃病需要做手术| 黄体是什么意思| 包场是什么意思| 为什么会湿疹| 爻是什么意思| 龙眼是什么季节的水果| 连号的钱为什么不能花| 香叶是什么树的叶子| 教师节贺卡上写什么| 肌醇是什么| 五月一号什么星座| 男人喜欢什么罩杯| 沙参长什么样子图片| 痔疮不治会有什么危害| 调理月经吃什么药最好| 麻疹是什么病| 肉字是什么结构| 月经来了吃什么好| 夏占生女是什么意思| 老死不相往来什么意思| 过敏性皮炎吃什么药| 久经沙场是什么意思| 7月15是什么星座| 褪黑素不能和什么一起吃| 中性粒细胞偏低是什么原因| 烧心吃什么食物好得快| 恩施玉露是什么茶| 什么时候打仗| 窦性心律室性早搏是什么意思| 葡挞跟蛋挞有什么区别| 什么时候是排卵期| 道观是什么意思| 公共关系是什么意思| 什么东西蛋白质含量高| 海带不能和什么一起吃| 消化快容易饿什么原因| 胎盘低是什么意思| 姜黄是什么东西| 六月十五是什么星座| 桂枝和肉桂有什么区别| 左眼皮一直跳是什么预兆| 吃什么补营养最快| 湿气重挂什么科| 血小板吃什么补得快点| 辐照食品什么意思| 白莲子和红莲子有什么区别| 人流需要准备什么| 甲胎蛋白偏高说明什么| 得逞是什么意思| 外阴炎是什么原因引起的| 肾病到什么程度腿会肿| 心肌病吃什么药| 血小板分布宽度是什么意思| 脖子下面是什么部位| 四不放过是指什么| 山水有相逢是什么意思| 牛肉不能跟什么一起吃| 吃什么帮助消化| 什么是ts| 西南属什么五行| 人为什么会低血糖| 钙片什么时间吃最好| 大便粘马桶吃什么药| 伤口用什么消毒最好| 齿加禹念什么| 脚气挂什么科室| 四个月是什么字| 身旺是什么意思| 芥末是什么做的| 6月23号是什么星座| 血压偏高吃什么药| 硝苯地平是什么药| 淋巴细胞计数偏高是什么原因| 账单日是什么意思| lee是什么品牌| 什么洗发水最好| 比肩劫财是什么意思| 特种兵是什么兵种| design是什么品牌| 内啡肽是什么| 眼皮发肿是什么原因| 什么一边什么一边什么| 关节炎吃什么药| 月经期间喝红糖水有什么好处| 做好自己是什么意思| 逍遥丸什么人不能吃| 假体隆胸什么材料好| 静谧时光什么意思| 论文检索号是什么| 一个不一个好念什么| 流鼻血挂什么科| 胸前有痣代表什么意思| 胎盘位于前壁是什么意思| 乳房胀痛是什么原因引起的| 左眼皮跳是什么意思| 地板砖什么颜色好看| 马路上的菱形标志是什么意思| 脾胃不好有什么症状表现| 坐飞机不能带什么物品| 心梗吃什么药效果好| 入木三分是什么意思| 吹空调咳嗽是什么原因| 牡丹王是什么茶| 百度

Wednesday, October 29, 2014

“海龙Ⅲ”潜水器完成首次海试

百度 后来给一家快餐店供货,也因为经验不足导致顾客跑单。

Ray Robertson:

Apple introduced a great variety of new automation features and updates in Yosemite. I’ve written up a quick summary below with links to more detailed information.

Daniel Jalkut:

Unfortunately the progress feature of AppleScript has not been exposed to 3rd party developers, so far as I can tell.

AppleScript Release Notes:

AppleScript/Objective-C is now available to all scripts, not just library scripts.

I’ve been wanting this feature for years. You no longer have to create a special AppleScriptObjC application; you can use it from any script. This will be useful both for the powerful Cocoa APIs as well as the many basic data structures and operations that were never part of AppleScript.

Here are some examples:

use framework "Foundation"

-- Calling an Objective-C class method:
get current application's NSDate's timeIntervalSinceReferenceDate()

-- Use pipes to avoid conflicts with AppleScript keywords.
get current application's NSDate's |date|'s timeIntervalSinceReferenceDate()

-- Basically, you just use “'s” in place of “.”.
set _array to current application's NSMutableArray's alloc()'s init()

-- “count” is also reserved.
get _array's |count|()

-- AppleScript changes “_array's addObject_(1)” to the interleaved syntax:
_array's addObject:1

-- AppleScript changes “_array's insertObject_atIndex_(0, 0)” to:
_array's insertObject:0 atIndex:0

set _string to _array's |description|()
set _appleScriptString to _string as Unicode text

set _data to _string's dataUsingEncoding:(current application's NSUTF8StringEncoding)
set _tildePath to current application's NSString's stringWithString:"~/Desktop/test"
set _path to _tildePath's stringByExpandingTildeInPath()
set {_ok, _error} to _data's writeToFile:_path options:0 |error|:(reference)
-- Should return “{1, missing value}”.
-- The file will contain “(0, 1)”.

Unfortunately, it looks like the technology is not yet very mature. Script Editor beach balled and had to be force-quit half a dozen times while I was writing this sample.

Update (2025-08-07): Joris Kluivers shows that developers can get at the progress of a script—via NSProgress.

Update (2025-08-07): Mark Aldritt:

What is not explained is how a host application can access this information and display a script’s progress in its own UI. Here’s how you do it.

At intervals the script will call the OSAActiveProc. Within this callback function you can make OSA calls that access the running script’s state. You start by getting a reference to the ‘AppleScript’ object. From there you can read the value of the four progress properties.

5 Comments RSS · Twitter


Getting the products to work in a reliable fashion is the real problem right now. Ideally what Apple should do is make Swift a full scripting language for these sorts of things. Right now trying to use Swift to do these sorts of things is still more of a nightmare than it has to be. Although it has gotten slightly better. But nothing compared to what Python + Appscript used to offer.


@Clark I really don’t see how Swift can be used as a scripting language. Even with the most basic tasks, it seems like you really have to help out the type inferencer. Then add Scripting Bridge to the fun…

I just want the bridge to work well from AppleScript. Looking at samples in Activity Monitor, it looks like the problem I ran into isn’t even due to AppleScript—rather, some sort of Extensions issue.


@Clark: what Michael says. For scripting, where you're often throwing together some quick-n-dirty code to run once or twice then throw away, you really want a simpler, tighter language with soft typing and a degree of exception handling. (What I'd really like is a scripting language that ditches all the bureaucratic syntactic and semantic baggage that's accreted from the Algol/C world, and returns to the laser-sharp parsimony of Logo/Smalltalk.)

@Michael: 10.10's elimination of the painful limitations on AS-ObjC integration is belated but welcome. One thing I've found is that using ASOC from Python via PyObjC is surprisingly easy. Stick one or more .scpt files containing ASOC classes into a folder, e.g.:

use framework "Foundation"
use scripting additions

script ASOCTest
   property parent : class "NSObject"
   --
   on test()
      activate
      display dialog "Hello from AppleScript!"
   end test
end script

then just use it from Python like this:

from Foundation import NSBundle, NSClassFromString
import AppleScriptObjC

NSBundle.alloc().initWithPath_(FOLDERPATH).loadAppleScriptObjectiveCScripts()

ASOCTest = NSClassFromString(u"ASOCTest") # get the ASOC class...
ASOCTest.alloc().init().test() # ...then instantiate and call it

Not as clean as a native bridge, natch, but it's all 100% currently supported APIs with no 3rd-party dependencies and lets you use AppleScript for what it's good at (application scripting) and Python for everything else.


(Apologies for glitchy formatting; not sure what the correct tags should be.)


@has Thanks for the PyObjC example. I changed the tags to <pre>.

Leave a Comment

nec是什么牌子 出水痘不能吃什么食物 做完胃镜可以吃什么 黄体功能不全是什么意思 扁平疣是什么
糖耐什么时候检查 烟雾病是什么 高丽参和红参有什么区别 什么是心脏造影 籍贯填什么
为什么得疱疹病毒 送日子是什么意思 邀请的意思是什么 地素女装属于什么档次 骨密度z值是什么意思
酉是什么字 乙状结肠管状腺瘤是什么意思 人的五官指什么 阴囊长白毛是什么原因 麻醉对身体有什么伤害
胸膜炎吃什么消炎药hcv7jop6ns2r.cn 男人肾虚吃什么补得快hcv8jop6ns7r.cn 牙周炎有什么症状hcv8jop6ns6r.cn 结婚8年是什么婚hcv7jop7ns1r.cn coach是什么牌子的包cl108k.com
甲亢病吃什么药效果好hcv8jop8ns1r.cn 什么是视同缴费hcv7jop7ns2r.cn 益生菌适合什么人群吃hcv9jop1ns4r.cn 大秀是什么意思hcv8jop3ns2r.cn 黄芪和什么搭配不上火hcv8jop7ns6r.cn
辰砂和朱砂有什么区别hcv7jop6ns5r.cn 眼圈发黑什么原因hcv8jop6ns1r.cn 荷叶茶有什么功效和作用hcv7jop6ns5r.cn 心悸心慌焦虑吃什么药能缓解travellingsim.com 肾阴虚吃什么药最好hcv8jop7ns6r.cn
铁是补什么的hcv9jop6ns9r.cn 睾丸痒用什么药hcv9jop1ns8r.cn 丹五行属性是什么hcv8jop8ns6r.cn 神父是什么意思hcv8jop9ns8r.cn 难为情是什么意思hcv8jop4ns1r.cn
百度