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.
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.
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
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.
Related
I'm a newbie to Mac OS and learning with Automator, I found it useful but not quite controllable. I made a shortcut in services but I don't know how to delete it.
The item highlighted is what I want to delete. I think I should do it with Automator but I don't find out how.
Any help will be appreciated.
crtl + mouse click on the service to get a context menu for the service.
Select Show in Finder.
This will take you to the service file by opening a new finder window and selecting it.
You then just need to remove the file from the Services folder.
When close and re-open the System Prefs. The Service will not be there anymore.
Here Are Some Good Things to Know Too
#markhunte seems to have a good answer, but here's another way:
If you are within Automator.app,
Open the Service that you want to delete. You may have to choose "Open..." from the menu and type the key-combination command-shift-period to view invisible files such as ~/Library (which is now invisible by default in Mountain Lion.)
Your services (the ones that are local to your account) are in the folder: ~/Library/Services
After opening your Service in Automator, hold down the command-key and click the title of the window. (This works in most Mac applications -- not just in Automator to reveal documents in the Finder.)
Once you've found the document in the Finder, you can simply move it to the Trash like any other document.
Also, other kinds of Automator workflows can be found in a similar manner in the following directory:
~/Library/Workflows/Applications
I think that with this sort of Thing that Apple has just made it hard.
With the folder ~/Library now being hidden by default.
With having to know the "secret-handshake" command-shift-period to be able to open hidden files.
and
To have a way to reveal documents in the Finder, but have it also a "secret-handshake" of holding down the command-key while clicking on a document window's title to be able to reveal documents in the Finder.
I think that to get Apple to change these things, the way that they listen is if many developers file a bug report:
Apple's Bug Reporter:
https://developer.apple.com/bug-reporting/
Look in ~/Library/Services or /Library/Services
In the Finder, ~/Library is now an invisible folder by default in Mountain Lion. Of course, people can google for "Mac show hidden files" and find a command to enter into the command-line to make all files and folders visible. As a programmer, I like being able to see everything.
Unix Command:
defaults write com.apple.Finder AppleShowAllFiles TRUE
Reference:
http://osxdaily.com/2009/02/25/show-hidden-files-in-os-x/
In Cocoa on Mac, I would like to add a menu item in the Finder's popup menu that comes when I right-click on a file or a folder, and having this item pointing to a function in my app.
How can I achieve this ?
Thanks !
A good place to start is CocoaDev: StandardService. It outlines what you are trying to accomplish and they give some source code to follow such as the MakingServices example.
2015 Update: As of Yosemite, Apple includes an extension called Finder Sync which allows you to accomplish most of what a Service used to do.
Best of luck.
I have created a custom AppleScript that works, and placed it in the folder:
~/Library/Application Support/iTerm/Scripts
As described in the documentation here:
http://www.iterm2.com/#/section/documentation/scripting
However I don't see a "Scripts" menu in iTerm2 after restarting, as advertised.
Any ideas? Thanks
Easy. For some reason, iTerm only shows scripts that were saved with the "Run Only" option (I think they're precompiled scripts in a binary format) in that Script menu. Unfortunately, these scripts cannot be modified, so it's a good idea to also save them as text files or as editable applescript documents.
Is there anything like the input manager for TextMate (at the very end of the page) which allows to edit from any Cocoa text edit controls in TextMate? It basically installs a menu "Edit in TextMate...". I tried to search for it, but I have not find anything. I think it would be very nice to have such a feature.
Thanks.
I haven't tried it (I keep meaning to), but QuickCursor is supposed to do that (for any editor, not just Emacs).
As noted in the comment, this requires ODB support, for which EditorClient can be used.
Aquamacs just added ODB support. You should be able to try it in a nightly build.
I don't know of one, but it should be fairly straightforward to hack one. You'd simply want to call emacslient with the path.
Is it possible to launch an external image editor from the TextMate project drawer? I suppose the same concept would apply to launching any external editor from TextMate. Right now, if I right-click on the image file, I only have an option to open in Preview or Finder.
Thanks!
Yes. There is an (official) TM Bundle that does what you want--it's called "ImageBrowser." I installed recently and i have used it only once. It seems to work fine for the purpose you mentioned in your Question; in particular, it finds images in your current project and displays them in an image browser that runs inside TextMate.
You can get it from the Macromates SVN Repository.
TextMate respects the Finder's (well, LauchService's) "Open with" choice for each file. Whichever program would open when you double-click the file in Finder will appear in TextMate's contextual menu. Simply change this through the Finder's Get Info window for the file in question to the editor of your choice, and TextMate will respect it. It's dynamically populated, so you don't need to restart TextMate.
As far as I know, there's no method to specify a secondary program beyond the default.
I think no is the answer, but like Matt said, explore the usage of the Services menu.