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.
Related
I want to make iTerm2 as my default terminal on macOS,
I open iTerm2 and hit to make iTerm default Term
But it's not working!
And I go to default terminal preferences
But after open it I see this
(Open iTerm Build version 3.3.7)
Menu: iTerm2 > Make iTerm2 Default Term
It sounds like you need to rebuild your macOS' LaunchServices.
To do this, download OnyX and choose the version based on your current macOS version.
The option that you need is in the red box, and I'd suggest that you UNCHECK anything that you don't need or don't know; otherwise, you might end up with deleting data that you might need:
After that, you can try again with the built-in Make iTerm2 Default Term option in iTerm2 (if this option is greyed out for you, click option + the iTerm menu button to re-enable it again).
There are ways to do this through the command line without downloading third-party apps, but I trust OnyX enough to hand it the job.
However, if you decide to do it from the command line, make sure you type the command that corresponds to your current macOS version. More on that here.
Hope this helps :)
Use this location instead:
/Applications/iTerm.app/Contents/MacOS/iTerm2
but note that it will not solve your issue completely. Termianal will start anyway, but this time, it will run iTerm2 - as you instructed it to do.
One thing you can do is find the file that opens a terminal (in my case it was metro opening in a React Native app). Find the file in your finder, right click on it, choose get info, then expand the Open With tab. There you should find a dropdown menu on what to open those kind of files with. The default is terminal, but choose iTerm2 and click on change all.
For example, in my situation I had to find launchPackager.command file under node_modules/react-native/scripts/. Do the above with that file and it will make iTerm your default terminal after clicking change all.
From where do you want to open the terminal? I was facing the same problem as you when I wanted to open the external terminal from Visual Studio Code.
I solved it by going to Code > Preferences > Settings. Look for terminal in the search bar and setting /Applications/iTerm.app in Terminal > External for your operating system.
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/
I have created a fonts and colors theme for code editing in XCode 4.3 on my laptop that I am particularly happy with, and I would like to export this and then re-import it onto my desktop.
Since going to this new App version of XCode, I can't appear to find anything user preferences related in ~\Library any more. Does anyone know where the fonts and colors setting is now stored, or how to export/import an XCode color theme?
The folder is still there it is just hidden in Lion. You need to copy the file using terminal or show hidden files by typing in terminal 'defaults write com.apple.finder AppleShowAllFiles TRUE'
The path is:
~/Library/Developer/Xcode/UserData/FontAndColorThemes
You don't actually have to use terminal, you can access that folder by using "Go to Folder…" in the "Go" menu in Finder's Menu Bar. The keyboard shortcut is shift+command+G.
Paste ~/Library/Developer/Xcode/UserData/FontAndColorThemes in the resulting dialog.
Note: this folder only exists once you add or duplicate a theme.
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.
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.