Custom Terminal Applescripts for Alfred to Fix iTerm Behaviour

I have put together some custom terminal applescripts in the last week for those that use Alfred for the Mac and iTerm. For those of you that have been finding finding issues with some of the newer versions of iTerm (including iTerm 2, and 2.9) and getting them to work reliably with Alfred, all this has required is an update to the Applescripts that are being used by Alfred to keep up with the (seemingly rapid) changes to the functions iTerm exposes with Applescript. Some issues I have faced go so far as iTerm simply not opening (where there were multiple iTerm binaries on the system), and sometimes commands not being passed through to newer versions.

There are two versions of the script available:

Each of these can be inserted into Alfred by following these steps:

  1. Load the Alfred control panel
  2. Click the Features Button/Tab
  3. Click on the “Terminal/Shell” menu on the left hand side
  4. Select “Custom” under application, and replace the text in the new box that appears with the code as per the version of iTerm you are running.

iTerm 2.1 Branch Custom Terminal Script Features:

The 2.1 branch script is very basic and just corrects the opening of iTerm and creating a new session properly.

iTerm 2.9 Branch Custom Terminal Script Features:

The 2.9 Branch goes a bit further to utilise some of the new features of iTerm 2.9 (which is in beta at the moment and can be downloaded if you are feeling adventurous from the iTerm download page). The script has been designed to achieve the following:

  • Open the correct iTerm binary under /Applications/iTerm.app regardless of if another iterm/iTerm binary exists on the system
  • Always create a new tab/session, unless iTerm is not running, in which case use the default session.
  • If the user has selected to not create a default session on iTerm startup, detect and create a default session.

Future Updates:

As new versions come out of the 2.9 branch I will keep the scripts up to date and post details to the official AlfredApp community forum post, if anyone finds issues with the 2.1 branch please let me know either there, or in a comment below and I will test things out.

If you would like to look at/contribute to the official repository please check it out on Github –> https://github.com/s…ipts-for-alfred.

As always, I welcome ideas/thoughts/feedback etc.

Cheers,
Stuart

Default Browser workflow for Alfred

DefaultBrowser Alfred Workflow IconI am happy to release version 1.1 of the Default Browser workflow for Alfred.

This is a workflow that I have been putting together for some time and today I have released a major update to include more browsers, improved speed and a general overhaul of awesomeness.

If you have ever wanted to be able to quickly switch browsers on OSX, this might just be up your alley. My biggest desire was to be able to switch between Chrome (just an awesome browser) and Safari (for when I need to be power conscious while running on battery). This Alfred workflow fits that bill perfectly.

Where you can get it

  1. Download the .alfredworkflow file from github directly
  2. Check out the official post on the Alfred Community forums
  3. Have a browse of the workflow on Packal – the global repository for Alfred workflows

Donations

This workflow represents many hours effort of development, testing and rework. The images that have been licensed for this workflow from DepositPhotos also needed a bit of my moolah. So if you love the workflow, and get use out of it every day, if you would like to donate as a thank you to buy me more caffeine giving Diet Coke, some Cake, or to put towards a shiny new gadget you can donate to me via Paypal.

Paypal donate button

 

 

 

Browsers currently supported:

  • Chrome
  • Firefox
  • Opera
  • Safari
  • Chromium – New in V1.1
  • Canary – New in V1.1
  • SeaMonkey – New in V1.1

Change Log

  • Version 1.1 – Feature Release
    • Feature: Support additional browsers – added Chromium, Canary and SeaMonkey
    • Feature: Only show installed browsers
    • Feature: Indicate which browser is the current default
    • Feature: Added hotkey assignments (to launch workflow, launch with “chrome”, and launch with “safari”)
    • Improvement: Renamed description in Alfred to simply “Default Browser”
    • Improvement: Improved failure feedback
    • Improvement: Major code refactor to remove duplication and speed up the workflow
    • Improvement: Added an icon to the workflow
    • Improvement: defaultbrowser binary has been updated to better support integrating. This code has been put into a pull request for the official publication of defaultbrowser.

Credits

defaultbrowser binary for OSX has been created by Margus Kerma.

  • Margus has been kind enough to permit me to include the binary for defaultbrowser as part of this workflow to make distribution significantly easier.
  • For any issues with the defaultbrowser binary please log these to the official DefaultBrowser Issue Tracker.

DefaultBrowser Alfred workflow created by Stuart Ryan. If you would like to get into contact you can do so via:

License

With the exception of the workflow logo, this Alfred Workflow is provided free of charge under the GNU GENERAL PUBLIC LICENSE Version 2 June 1991.

The workflow logo is licensed only for use in this workflow and must be changed if the workflow is forked in the future.

The workflow logo has been licensed from DepositPhotos to Stuart Ryan.
DefaultBrowser Example Screenshot 1 - List Installed Browsers

DefaultBrowser Example Screenshot 2 -  Set Safari as Default

DefaultBrowser Example Screenshot 3

DefaultBrowser Example Screenshot 4 -  No such browser installed error

Rapid Browser Tabs Workflow for Alfred

Rapid Browser Tabs for Alfred LogoSome time ago while using the Search Tabs on Safari and Chrome workflow for Alfred developed by Clinton Strong, I came up with the idea to enhance the workflow to enable the addition of often used “favourites” to speed up getting access to the websites you need. After many hours of programming, many nights of testing, a splash of blood, sweat and tears and an inordinate amount of caffeine while learning how to program in Ruby :D, I can now present Rapid Browser Tabs for Safari and Chrome.

RBT for Alfred has been forked from the Search Tabs on Safari and Chrome workflow (with Clinton’s blessing) and could almost be considered v2 of Clinton’s original workflow. In addition to the ability to searching already open Chrome and Safari tabs and bring them into focus rapidly, it adds the ability to create favourites that can be searched and opened alongside already open tabs in Chrome and Safari.

So, if you are an avid Alfred user, you can get the workflow from the official Github repository directly and log any issues/ideas/feature requests on Github. You can get the full details on use of the workflow in the official Alfred Community Forum post, and it is also up on Packal as well.

License

All code in this workflow is released under the MIT License. Images used as part of the workflow are licensed only for use in this workflow and must be changed if the workflow is forked in the future.

All images have been licensed from DepositPhotos to Stuart Ryan.

Donations

This workflow represents many many hours effort of development, testing and rework. The images licensed for this workflow from DepositPhotos also needed a bit of my moolah. So if you love the workflow, and get use out of it every day, if you would like to donate as a thank you to buy me more caffeine giving Diet Coke, some cake, or to put towards a shiny new gadget you can donate to me via Paypal.

Contributing

If you are a coder head over to the official Github repo:

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am ‘Add some feature’
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Command your browser tabs… and don’t let them command you!

Rapid Browser Tabs Workflow for Safari and Chrome on Alfred App - Pre Configure Screen
Rapid Browser Tabs Workflow for Safari and Chrome on Alfred App - Configure Screen

Rapid Browser Tabs Workflow for Safari and Chrome on Alfred App - Facebook Example

Rapid Browser Tabs Workflow for Safari and Chrome on Alfred App - Favourites Example