June 2013
2 posts
May 2013
4 posts
In my seemingly endless pursuit of proving to no one in particular that anything can be done through Applescript, I wrote a little parsing agent to pull the full list of users from Zendesk, and display their name and phone number.
It could be modified to parse out anything about the users, and in principal could be used to pull ticket info, company info, and whatever else the API allows. To be fair, it’s just a curl wrapped in a do shell script, but I’m still proud of it. Here’s the core line to get the information:
do shell script “curl https://subdomain.zendesk.com/api/v2/users.json -v -u user@email.com:’password’”
AS A SIDE NOTE, I found that if I didn’t wrap the password call in quotes, special characters would be recognized by the curl command and confuse it.
If you’d like to see the script in it’s entirety just let me know, otherwise Comments, Questions, and Suggestions are always welcome!
There’s a fairly common issue of Calendar accounts in iCal/Calendar (often Exchange based) not syncing and giving odd errors about the user not having permission to edit the calendar While it’s no always a permanent fix, the simplest thing to do is remove the Calendar Cache file, which in some cases becomes duplicated and corrupted.
This script removes any Calendar Cache files so things can get going again. Comments, Questions, Suggestions? I’m here to help and always looking for feedback!
I recently began working for a company that’s heavy on the Google and 37Signals solutions. This is great, since I use the same things personally, and love the tools.
However, I hit a snag when it came to calendar management. I use Fantastical from @Flexibits, which I absolutely love, but it doesn’t show Google Hangout links (and to be fair, neither does Apple Calendar, Outlook, or most calendar clients). Sure, I could just fire up my Google Calendar in a browser, but since I do everything else in FanCal it’s annoying enough to bother me.
So, I pulled up Applescript and got to work. Turns out, to my favor, the hangout link is stored in the ICS file that Apple Calendar keeps in a folder, which means the information is all there waiting.
I scripted pulling that field out whenever a new event is added automatically (using a folder action), and added it to the same event’s description (notes) field, which is visible in FanCal. I tried adding it to the URL, which FanCal also displays from the menubar, but no joy, it doesn’t show for some reason.
Anyway, now I can go to the same place for everything, another first world problem solved with Applescript, and valuable time saved. You can download the script below, which includes a setup help, so just follow the included instructions and you’ll be good to go!
Comments, Questions, Suggestions? I’m here to help and always looking for feedback!
I have several pairs of headphones, some bluetooth, some wireless, and some the old fashioned audio jack variety. Problem is, they don’t always auto detect and switch over when I disconnect or reconnect them.
So, with a little help from the illustrious blog of whosawwhatsist, I wrote this little baby. It pops up a window with the available audio outputs, then switches to the one you choose. That simple.
It relies on the included shell command, which you’ll need to move to your usr/bin folder, unless you keep things somewhere else. Once that’s there, you’re all set to go.
Audio Device Switcher Download
Comments, Questions, Suggestions? I’m here to help and always looking for feedback!
April 2013
4 posts
Most decent text editors have a word count function, often accessible by a shortcut key or menu item. Some even display an active count in the current document. But what if you’re writing outside of a traditional editor, or have a section of text in a web page and need a word count?
This little app takes care of it. Just drop it in your Dock for easy access (that’s what she said), select some text in any application, and click the app. A little window will pop up with your word count.
I use this primarily when writing in Evernote, but it’s very helpful on websites as well, and even PDF documents open in Preview.
Comments, Questions, Suggestions? I’m here to help and always looking for feedback!
Once I’ve made an Applescript an App, you can’t just double click it to reopen in Applescript. This can be a bit frustrating, especially with apps I haven’t had open recently in Applescript.
So this little droplet (which I keep on my dock), taks any applescript app file you drop on it, and opens it in Applescript Editor (or in my case Script Debugger), like it would any script file. Very convenient and time saving.
Comments, Questions, Suggestions? I’m here to help and always looking for feedback!
I had a client with a ridiculous amount EPS files that needed to be PNG files. Sure, you could do an export, but that’s just silly. Why not have a folder action? Just drop files into the folder, and voila, a new folder is created with all the converted files in it.
It even has a nifty progress bar! To use that feature with the Folder Action, you’ll need to move the SKProgressBar.app file in the zip bundle to your Users application folder. The manual version of the app doesn’t require any additional steps, just run the thing.
It could easily be modified to work as a droplet, and I’ve included a second link to run it manually.
Comments, Questions, Suggestions? I’m here to help and always looking for feedback!
March 2013
3 posts
I’ve been making a frivolous effort to rid myself of any need for Firefox (nothing personal, just has some personal baggage for me). More than anything, I just don’t want to use more than one browser if I don’t have to, and I love me some Chrome.
All that to say, the only thing I really used Firefox for was opening Magnet Links to…borrowed internet files…for Transmission. I found a few workarounds, but nothing Mac specific. After some digging, was able to get the windows instructions to work for me Mac side:
- With Chrome closed, open the following file (I used Pico, but you could use any TextEditor):
User/Library/’Application Support’/Google/Chrome/’Local State’ - Find the “protocol_handler” line, and the magnet sub line.
- Change its state from true to false.
- Save the file, reopen Chrome, and you’re mageneting baby!
Comments, Questions, Suggestions? I’m here to help and always looking for feedback!
Just wrote these up for a programmer friend of mine. Keep in mind they are both GUI scripts, so rather than run in the background, it will run front and center, but make the changes automatically.
Caps Lock Toggle (click here to get it)
This little guy will switches the Caps Lock function from standard Caps Lock to the Control key. Should help any devs dependent on that switching for easier development on a Mac.
Natural Scrolling Toggle (click here to get it)
Have a need for Natural Scrolling to be on every once in awhile? This one switches it back and forth between states. Personally, I despise the feature, but who am I to judge the all natural, whole grain, hippie scrolling weirdos…
Comments, Questions, Suggestions? I’m here to help and always looking for feedback!
February 2013
7 posts
I’ve seen quite a few ways to do this online, but they all either leave character artifacts behind, or don’t finish running. So here, dear readers, is the simplest way to get a Mac’s serial number through Terminal:
ioreg -l | awk ‘/IOPlatformSerialNumber/ { print $4;}’ | sed ‘s/"//g’
Enjoy!
For so long, I’ve wanted a script that got me the warranty status of the Mac I’m working on. Granted, it’s not that hard to open the support page and put in the serial, but I do it enough that it gets frustrating.
Thanks to some JavaScript advice from a friend, I finally have it working! When you run the little app, you’re given the option to check the status of the Mac you’re on, or manually enter a Serial Number.
Then, it opens a page in Safari, submits the information (after a few seconds delay), and pulls up the response. Make sure that you wait when you run it, don’t think it’s not working just because it waits.
So thanks to Tim the Tool Man for his help, and enjoy the automation!
Just finished another Fiverr project, this one ties into Evernote through Folder Actions. Unfamiliar with Folder Actions? Educate Yourself! Honestly, I don’t use them as much as I should, they’re a brilliant tool for automating your daily workflow.
Anyway, here’s how this script works:
- Move the script to your Folder Action Scripts folder (MacintoshHD->Library->Scripts->Folder Action Scripts).
- Make a new folder.
- Assign the EvernoteAdd script to that folder.
- Drop a text file into the folder and voila!
The script is a fairly standard folder action, that gets the text from any text files dropped into the folder, then creates a new note in Evernote with its information (file name without extension for the title, and body of the file for the note content).
I’m starting to use Evernote quite a bit more, especially after getting a Moleskin Evernote Journal, and it’s really encouraging to see how well it’s integrated with Applescript.
Download the script here.
Comments, Questions, Suggestions? I’m here to help and always looking for feedback!
I may or may not play a bit too much Minecraft. On the Mac, you can’t Quit from the menu, or using Command + Q. You have to click the window close button in the upper left corner of the window. While it might seem silly to be bothered by that, I am.
So I wrote the following little script, that toggles Minecraft. Click it while it’s closed, it opens. Click it while it’s open, it closes. That simple. Enjoy!
Just finished polishing up 2 new Applescripts that I’m pretty excited about. The first one was a project for work, and the second a Fiverr.com gig (which took way too long to complete, but turned out pretty good). So without further ado, here they are:
Script 1: Bluetooth Battery Notification
This is really simple, but really helpful for Mac Admins. It sends an email to a specified address when the battery level of a users Apple bluetooth mouse and/or keyboard is below 16%. When first run, the script asks for an email address and which email client you use. Then, from that point on it will send from that client, to that address.
This information is stored in a text file in your Documents folder, labeled BluetoothNotifierSetting.txt, so it can always be edited later on. The idea is to schedule the script through Calendar/iCal, to run at whatever interval you want. It takes less than 2 seconds to complete if no email is being sent, and only a second or two more if one is.
It’s attached below as a script file, but can easily be saved as an Application through Applescript to be run manually (I’ve tested it both ways).
Script 2: Video Conversion Droplet
There are a lot of video conversion software products out there, many of which do a great job and don’t need replaced. This was written for a client that needed a simple droplet to convert whatever video file you put on it, into an mp4 file. It will accept either individual files or a folder.
The beauty here (and the extended labor invested) is that it features progress bar, my first Applescript to do so. Cliche? Maybe, but it’s fun and it works, so enjoy!
Script 1 Download - Bluetooth Battery Notification
Script 2 Download - Video Conversion Droplet
Questions and feedback on either are always welcome!