applescript choose file title

2019-09-07 05:20发布

问题:

I have got a choose file in my applescript. How do I change the title of the Choose a File window that comes up. I am aware of with prompt, but it doesn't change the title.

Edit: ulvund answered I'm afraid with prompt is the best you can do, but are there any other ways to get a choose file without applescript? Also, are there any hacks?

Edit 2: Red_Menace answered (look below) but are there any good tutorials on how to do this in Cocoa-Applescript?

P.S. Look at my comments.

Edit 3: I have put this into another question.

回答1:

The dialog in plain AppleScript doesn't have that option, but you can access various Cocoa methods in Snow Leopard and Lion using AppleScriptObjC. In Lion, you can create a Cocoa-AppleScript Applet from the template in the AppleScript Editor, then create your own dialog, for example using NSOpenPanel.



回答2:

I'm afraid with prompt is the best you can do:

http://docs.info.apple.com/article.html?path=AppleScript/2.1/en/as309.html



回答3:

An answer to the edited question: You can use Automator.

Ask for Finder Items action in Files & Folders library will show the choose file dialog. You can change the title of the dialog of this action.