Subject22 Posted April 7, 2013 Share Posted April 7, 2013 (edited) A while back a mate managed to lock me out of my room and and proceeded to tinker with my computer while I watched helplessly through a window. I wasn't going to take that lying down so I used my iPad to airplay Liam Neeson's immortal line from Taken to the speakers in my room. My friend was suitably freaked out Since I've been having fun using Alfred 2 to automate every tiny little function on my computer I thought I might as well throw this workflow together. It uses an Applescript to: Pause iTunes if it's playing Set the computer's volume to maximum Play the audio clip Set volume and mute to their original settings Resume iTunes playback (if it was playing) To use it you'll need to edit the script in the workflow with the path to the audio file (a copy of which is bundled with the workflow). More detailed instructions: Import the workflow into Alfred Double click the Run Script tile in the workflow Click "Open workflow folder" at the bottom right Note the file path to Taken_Audio.aif (you can find this by clicking and dragging the aif into Alfred ) Back in the Run File tile, scroll to the bottom of the script and edit the path to the audio file (it's located under "# Play the clip"). It's mostly filled out for you, all you really need to add is the long string of characters from the end of the workflow folder name. Download: Taken Keyword: taken Here's a standalone copy of the audio: Taken Audio Edited June 9, 2013 by Subject22 Link to comment
DJay Posted April 7, 2013 Share Posted April 7, 2013 nonsense but funny. don't think you need this terminal thing for the sound.. I used a sound file in a workflow a while ago and there was no need for the terminal. Just the afplay command. afplay /Users/Daniel/Dropbox/Alfred' '2/Alfred.alfredpreferences/workflows/user.workflow.C45FE129-2A09-4B30-AEB4-47BF282E78FB/move.aif Link to comment
Subject22 Posted April 8, 2013 Author Share Posted April 8, 2013 Haha, if that's your reaction, then it's done its job The funniest thing to me is that the audio clip's been downloaded twice as many times as the actual workflow xD I guess there's a dearth of good soundbites out there. Now that I think about it, I did have to do a little work to get that one. YouTube -> mp4 -> iMovie -> Export audioYou're right about not needing Terminal. For some reason I keep using tell app "Terminal" instead of do shell script, I have no idea why. I've changed that, and also bundled the audio with the workflow. The user will still need to specify the file path though, as the name of the workflow folder appears to be generated differently each time it's imported. I don't know how to get around that. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now