deanishe Posted April 7, 2014 Share Posted April 7, 2014 (edited) 2015-09-17: Major update to version 2Alfred AppScripts Workflow List, search and run/open AppleScripts for the active application.Download The workflow can be downloaded from GitHub or Packal. The source code is also available on GitHub.Usage .as [<query>] — Show/search list of AppleScripts for the active application ↩ — Run the selected script. ⌘+↩ — Open the selected script in Script Editor. ⌥+↩ — Reveal the selected script in Finder. appscripts [<query>] — Show workflow configuration. Help – Open this file in your browser. (No) Update Available — Whether or not the workflow can be updated. Action the item to update or force an update check. Search Directories Recursively – Whether the script directories should be searched recursively. Use with some caution. Edit Script Directories — Open the configuration file in your default editor. The file contains a detailed description of how it works. Reset to Defaults — Delete configuration and cache files. Where are these scripts? The workflow comes with a default set of directories. These are defined in a settings file that you can edit yourself. Use the Edit Script Directories option in the configuration (keyword appscripts) to open the file in your editor. These are the default directories. {app_name} will be replaced with the name of the currently active application, e.g. BBEdit or OmniFocus, and {bundle_id} with the application's bundle ID, e.g. com.barebones.bbedit or com.omnigroup.OmniFocus2: ~/Library/Scripts/Applications/{app_name} ~/Library/Scripts/Applications/{bundle_id} ~/Library/Application Scripts/{app_name} ~/Library/Application Scripts/{bundle_id} ~/Library/Application Support/{app_name}/Scripts ~/Library/Application Support/{bundle_id}/Scripts ~/Library/Containers/{bundle_id}/Data/Library/Application Support/{app_name}/Scripts Any .scpt, .applescript or *.scptd (script bundle) files found within the above directories will be shown. If you add a directory path that doesn't contain {app_name} or {bundle_id}, it will match every application and the scripts will always be shown. See the settings file (AppScript Directories.txt) for more information.Licence, thanks The workflow code and the bundled Alfred-Workflow and docopt libraries are all licensed under the MIT Licence. The workflow icon was kindly donated by @Jono. Edited November 2, 2018 by deanishe Carlos-Sz, rice.shawn and Jono 3 Link to comment
rice.shawn Posted April 7, 2014 Share Posted April 7, 2014 This looks pretty great, especially how context-sensitive it is. Now, go work on those 57 tasks that you have due. Link to comment
deanishe Posted April 7, 2014 Author Share Posted April 7, 2014 I thought about doing the demo again when I realised what a slob my OmniFocus makes me look. I should probably lie and say, "it's not how it looks!", but it's pretty much exactly how it looks I have todo's in there relating to companies that don't exist anymore and people who've died… WRT the workflow, my aim was to make a version of FastScripts for Alfred. It doesn't do the keyboard shortcuts, but the search works much better than in FastScript's script list. I wonder if I should add non-app-specific scripts, too. Link to comment
smarg19 Posted April 7, 2014 Share Posted April 7, 2014 This will probably be the thing that finally gets me to take all of my various Applescripts and actually put them in the appropriate App folders... Link to comment
deanishe Posted April 7, 2014 Author Share Posted April 7, 2014 You don't have FastScripts? It's amazing! Still, it's pretty pricey for what it is, and this workflow is likely a better solution if you're not constantly running application-specific scripts and don't need the app-specific keyboard shortcuts. Link to comment
smarg19 Posted April 7, 2014 Share Posted April 7, 2014 I have it, I just haven't really used it yet. In the past, I would lazily save applescripts that I wanted to use as .apps, then just use Alfred's basic app search to find and then run them. But I've wanted to get things better organized for a while now. Link to comment
deanishe Posted April 7, 2014 Author Share Posted April 7, 2014 FastScripts killer feature is app-specific keyboard shortcuts. I love that I can define a single cross-application shortcut for "Export". That said, Keyboard Maestro can do everything FastScripts can and a ridiculous amount more. Link to comment
dfay Posted April 23, 2014 Share Posted April 23, 2014 This is great, but I have at least one app that stores its scripts in ~/Library/Application Support/appname/Scripts Would it easily be possible to have the workflow search here as well>? deanishe 1 Link to comment
deanishe Posted April 23, 2014 Author Share Posted April 23, 2014 This is great, but I have at least one app that stores its scripts in ~/Library/Application Support/appname/Scripts Would it easily be possible to have the workflow search here as well>? That's a very good idea. I've added it to the workflow and the new version (1.1) is available from Packal and GitHub (links in the OP). dfay 1 Link to comment
Jono Posted April 24, 2014 Share Posted April 24, 2014 Excellent workflow, thanks! Here's my version of the AppleScripts folder, if you want to use that one http://d.pr/f/DTXn (And I'm one of those that prefer Keyboard Maestro over FastScripts ) deanishe 1 Link to comment
deanishe Posted April 25, 2014 Author Share Posted April 25, 2014 Thanks, Jono. Once again, that's much better than the icon I used. Will update the icon in the next version. Link to comment
dfay Posted April 25, 2014 Share Posted April 25, 2014 This is excellent. I also figured out that it will resolve aliases, as long as the alias is renamed e.g. from myscript.applescript alias to myscript.applescript which is great, since I have a lot of scripting project that I keep in their own directories (which I sync from one machine to another) rather than in the Library (which I don't sync). Link to comment
vasuffolk Posted July 30, 2015 Share Posted July 30, 2015 Many thanks for a great workflow (which would have been completely beyond me!) For any who find this - if you have loads of scripts for a given app (TextWrangler in my case), try grouping them by one or two letter prefixes. If you then fire up this workflow by typing .as (space) xy, you will get only those scripts starting with that prefix. Link to comment
deanishe Posted July 31, 2015 Author Share Posted July 31, 2015 Updated to v1.3. It should now run much faster. Link to comment
johnyull Posted September 16, 2015 Share Posted September 16, 2015 This is such a valuable workflow. Is there any way I can get it to run script bundles (com.apple.applescript.script-bundle). Specifically, I was going to run some iTunes script bundles (doug adams) using this, but the workflow only recognizes applescripts. Either way, its a great script. Link to comment
deanishe Posted September 17, 2015 Author Share Posted September 17, 2015 This is such a valuable workflow. Is there any way I can get it to run script bundles (com.apple.applescript.script-bundle). Specifically, I was going to run some iTunes script bundles (doug adams) using this, but the workflow only recognizes applescripts. Either way, its a great script. Easily done. I've added that in version 2, which I've just released. Now you can edit the list of directories that get searched for scripts, both app-specific and global ones. Link to comment
johnyull Posted September 17, 2015 Share Posted September 17, 2015 That's great. Thanks. For some reason the new workflow is not recognizing any scripts or script bundles now. All my scripts are organized in "~/Library/Scripts/Applications/iTunes/" as set up for FastSripts use. According to your instructions this path is included in the default. The old AppScripts workflow recognized this directory structure. Link to comment
deanishe Posted September 17, 2015 Author Share Posted September 17, 2015 Hmm. You could try resetting the workflow with ".as workflow:reset". If that doesn't work, could you post the output from Alfred's debugger? Link to comment
johnyull Posted September 17, 2015 Share Posted September 17, 2015 Sorry about that. I had so many iTunes scripts I had some in subfolders. It works perfectly now. Thanks. Great improvement on already great workflow. Link to comment
deanishe Posted September 17, 2015 Author Share Posted September 17, 2015 There's an option in the settings (enter "appscripts" in Alfred) to turn recursive search on (i.e. it will also search in subfolders). Does that help? It can take a few seconds to find all the scripts if there are a lot of directories to search. It might be worth your while removing the directories that don't exist from the configuration (enter "appscripts" in Alfred and action the "Edit Script Directories" item). Link to comment
johnyull Posted September 29, 2015 Share Posted September 29, 2015 Is there any way to use 2 versions of your script to access two separate folder locations so that the dropdown is split. Basically I'd love to be able to split my 20+ iTunes scripts into 10 a piece as they are primarily either "maintenance" or "navigation" oriented. I downloaded 2 versions of workflow, but when I changed the path of the folders in the second one it overwrote the first one. I thought that was going to happen. Link to comment
deanishe Posted September 29, 2015 Author Share Posted September 29, 2015 If you open the workflow's settings in Alfred Preferences (by double-clicking on the workflow in the left-hand-side workflow list) and change the Bundle Id, you can run two copies side-by-side. All workflow settings are saved under the bundle ID, so different bundle IDs means different settings.WARNING: If you update the workflow, the bundle ID will be reset to the default. If you change it back to your custom value, the settings should still be there, however. That said, the search filter is pretty smart, so if you prefix the names of your scripts with "Maintenance:" or "Nav:", you can quickly find, say, "Maintenance: Delete Old Podcasts" with the query "mdo", or "Nav: Cool Tracks" with "nct", i.e. starting your query with "m" or "n". Link to comment
deanishe Posted November 23, 2015 Author Share Posted November 23, 2015 Updated today. The new version should run a little bit faster. Link to comment
Maddog Posted December 26, 2015 Share Posted December 26, 2015 (edited) 1. I'm an applescript noob - is it possible to pass arguments from this workflow to an applescript? 2. Is it possible to run a specific script with hotkey? I've tried adding a hotkey and a script name parameter, but alfred still shows up and I still have to press enter, would be really cool if the script could run without showing alfred. Edited December 27, 2015 by Maddog 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