给apple script 签名 / 读 apple script

来源:互联网 发布:现货电脑看盘软件 编辑:程序博客网 时间:2024/05/21 15:48




http://www.macosxautomation.com/applescript/apps/readmyscripts.html


Sign My Scripts — Simpler code-signing


Free utility for those distributing AppleScript files

Sign My Scripts.app simplifies code-signing script applications. If you distribute script applications by email or the Web, users running Mountain Lion with the default setting for Gatekeeper will not have to use the control-click workaround to open them if they are properly code-signed.

Code-signing requires a valid Apple developer ID, which you can only get by joining Apple's paid developer program. The certificate for the ID needs to be installed in the keychain of the Mac on which you plan to code-sign your script apps.

To maintain their integrity, the code in code-signed scripts cannot be altered, which means they behave differently to normal scripts in that properties do not persist between launches — the script files cannot be written back to disk with the new values.

To use Sign My Scripts, drag a script app over its icon. If the app has no bundle identifier, you will be asked to provide one. Script apps have traditionally not included a bundle identifier, but AppleScript Editor in Mac OS X 10.8 is now providing one for all saved apps. (See below for what a bundle identifier entails.)

You will also be asked to enter the name used in your developer ID. You just need to enter the name used — the app will preceed it with "Developer ID Application: " automatically.

You will then get a normal authorization dialog, where you need to enter an adminsitrator's name and password to complete the process. Any .scpt and scptd files in the app will have their write privileges removed as part of the process.

Sign My Scripts is free, and the code is fully accessible. It is a standard AppleScript app itself, using System Events, the Finder and do shell script. You can modify it for your own use, but to do so you will need to save it as a new application because it is code-signed. It works only under Mac OS X 10.8.

Sign My Scripts may fail if you have not installed Xcode and its command-line tools on your Mac.

BUNDLE IDENTIFIER

From Apple's description of the bundle identifier (CFBundleIdentifier): Each distinct app or bundle on the system must have a unique bundle ID. The system uses this string to identify your app in many ways. [...] The bundle ID string must be a uniform type identifier (UTI) that contains only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) characters. The string should also be in reverse-DNS format. For example, if your company’s domain is Ajax.com and you create an app named Hello, you could assign the string com.Ajax.Hello as your app's bundle identifier. Note: Although formatted similarly to a UTI, the character set for a bundle identifier is more restrictive.

VERSION 1.0.3

This version incorporates changes suggested by Edward Mendelson, with thanks. You will now be prompted to replace generic (com.apple) bundle identifiers.

Click HERE to download Sign My Scripts.app 1.0.3.

Read My Scripts — Expose hidden code


Free utility for those exchanging AppleScript files

One of the subtle changes introduced in OS X 10.8 is that AppleScript Editor can now save uncompiled .scpt, .scptd and .app files. If these files are sent to users running different OS versions the source code will not be easily accessible, and they may assume it has been lost. Because it can happen accidentally, via autosaving, it is a potential disaster waiting to happen.

A more detailed discussion of the problem can be found at TidBITS: http://tidbits.com/article/13135.

Read My Scripts is a simple utility for easily accessing the hidden source of such files. If you have a file whose source appears as error "This script contains uncompiled changes and cannot be run." when you try to edit it, or you get the same text in an error dialog, Read My Scripts is what you need.

Just drag the file or files over Read My Scripts.app's icon, or double-click and choose them in the open panel that appears. New versions will be saved on your desktop. The new versions will contain the hidden code, but to make it appear in other than AppleScript Editor under OS X 10.8, the code will be completely commented out — each line will begin with "--#--" followed by a tab. You can remove this with a search and replace when you wish to edit the script. Importantly, it will remove the hidden source, to avoid a potential conflict if it is opened under 10.8 again.

The new files will be named by appending " commented" to the file name. Apart from the change of the script source and the removal of the hidden source, the new files will be identical to the originals.

Read My Scripts is not a script decompiler — if a script has been saved in a compiled form, Read My Scripts will ignore it.

Read My Scripts.app is free, and will run under OS X 10.5 and later, including PPC versions.

Click HERE to download Read My Scripts.app.

原创粉丝点击