OSX Lion Preview 应用程序是否可以编写脚本? [英] Is OSX Lion Preview application scriptable?

查看:25
本文介绍了OSX Lion Preview 应用程序是否可以编写脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

OSX Lion(或旧版 OSX)预览版是否可以编写脚本?

解决方案

Preview 现在不是,而且从来没有 AppleScript-able,这确实很糟糕.不过如果是这样就好了.

<块引用><块引用>

来自本博客:

然而,从 10.4-10.6 可以启用默认的 Cocoa通过这些终端命令支持脚本:

sudo 默认写入/Applications/Preview.app/Contents/InfoNSAppleScriptEnabled -bool 是须藤 chmod a+r/Applications/Preview.app/Contents/Info.plist

<块引用>

这足以能够获取当前文档的文件以将其删除,更改它的 Finder 标签,将其导入 EagleFiler 等.在 10.7 下,修改 Info.plist 文件会破坏应用程序的代码签名.我希望这会在控制台,但它实际上导致预览崩溃.

Is OSX Lion (or older OSX) release of Preview scriptable?

解决方案

Preview is not now, and have never been AppleScript-able, which does suck. It'd be nice if it were, though.

From this blog:

However, from 10.4–10.6 it was possible to enable the default Cocoa scripting support via these Terminal commands:

sudo defaults write /Applications/Preview.app/Contents/Info
NSAppleScriptEnabled -bool YES 

sudo chmod a+r /Applications/Preview.app/Contents/Info.plist 

This was sufficient to be able to get at the file of the current document to delete it, change its Finder label, import it into EagleFiler, etc. Under 10.7, modifying the Info.plist file breaks the application’s code signature. I would expect this to cause a harmless warning message in the Console, but it actually causes Preview to crash.

这篇关于OSX Lion Preview 应用程序是否可以编写脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆