applescript

Change Language Script for BBEdit

Do you want a script to quickly change the language of the current document in BBEdit?[1] Here you go: tell application "BBEdit" set source language of front text document to "Markdown" end tell I have several languages triggered by the same keyboard shortcut (ctrl-shift-L) using Keyboard Maestro. The group is only available while in BBEdit so there’s no need to include an “activate” command. Since they all use the same shortcut, I actually get a quick list to choose from.

Quick Notes With BBEdit

Occasionally I just want to make a quick note in NVAlt/Simplenote/Dropbox[1]. Of course, I can command tab to NVAlt and create a new note in relatively few clicks. But I’m using BBEdit more and more. If I want to create a quick note from BBEdit it’s not so quick. Here’s a modification of a script from John Gruber that creates a new note in my NVAlt Dropbox folder and opens it in BBEdit.

Dialog Window Bug in Automator

Automator has an odd bug that is very enticing. I'd love large text entry boxes in AppleScript dialogs, rather than the anemic single line input that is possible. Automator has an "Ask for Text" action that produces a similar dialog box. However, if the Title field is left empty the text entry box is five lines tall.  But, when a Title is provided, the scrawny single line text input box is back.

Using HTML Forms with AppleScript Link

This script by Nik Friedman is pretty interesting. It uses an HTML form for input rather than the crappy AppleScript dialogs. The approach involves bundling the form with the AppleScript and then loading it in a Safari window with a custom URI loading function in the AppleScript. Or something like that. He is able to produce an AppleScript form that looks pretty nice.

AppleScriptObjC Explored

Add this to the list of bad decisions I will make in 2012. I’m going to work through the entire book and see where I end up. I think I will either end up really liking Cocoa AppleScript, really hating AppleScript or mostly using Python. That’s almost where I am now.

Select Next Word Script for BBEdit

Continuing the riff on BBEdit, here's a script that uses the grep match for a single word. It's an AppleScript that I bound to the shift-cmd-right arrow combo. If there is no word selected, it selects the closest next word. If there is a word already selected, it selects the next whole word. It's a take on John Gruber's original Select+Word script with the additional benefit of being able to walk the selection down a line one word at a time.

Moving Text Editors Taking BBEdit Seriously

There are plenty of good reasons to be eagerly awaiting a stable release of Textmate 2 but there are also equally valid reasons to avoid it. I’ve used both but I’ve never been an expert at either. I’ve used them for small personal projects but nothing that would exercise all of the features. For web development, I use Coda, for python scripts, I use BBEdit and now CodeRunner. Most of my writing for this site is done between Simplenote, NVAlt and MultiMarkdown Composer.

AppleScript-Cocoa Over PyObjC?

What’s more odd to me, is that Apple has dropped the PyObjC support but gave AppleScript a giant boost with Cocoa-AppleScript. Don’t get me wrong, I like AppleScript fine, but it sure isn’t as flexible as Python or Ruby[1]. Anyway, if your thinking about making any AppleScript-Cocoa projects, here’s a very good tutorial over at MacScripter.  UPDATE: There are also great resources over at MacAutomation.com, including what looks like a good book.

Junecloud Automator Actions

Junecloud makes the terrific Delivery Status widget and Delivery Status Touch for iOS. If you do a lot of package tracking, these are the best tools available. But I noticed that they also provide a free set of Automator actions that are very handy. “Save for Web” generates images with specific size and quality settings. “Make Names Web-Friendly” replaces spaces and other special characters to web friendly characters such as underscores.

Scripting Bridge Redirect

A funny thing happened when I was reading through references for Python on OS X. Dr.Drang had a link to Apple's Scripting Bridge page. The funny part is that Apple appears to now redirect that page to the Automator page. It doesn't give me a lot of confidence in learning the Scripting Bridge. Here's the new home.