Coder Social home page Coder Social logo

deanishe / alfred-appscripts Goto Github PK

View Code? Open in Web Editor NEW
87.0 7.0 4.0 2.84 MB

Alfred workflow to search and run/open AppleScripts for the active application

License: MIT License

Python 99.45% Objective-C 0.34% Swift 0.14% Shell 0.06%
alfred alfred-workflow applescript python scripts search runner jxa

alfred-appscripts's Introduction

Alfred AppScripts Workflow

List, search and run/open AppleScripts for the active application. You can also specify directories that contain scripts that will always be shown, regardless of the active application.

Download

Note: Version 3.0 and above are not compatible with Alfred 2.

The workflow can be downloaded from GitHub releases or from Packal.

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, *.scptd (script bundle) or *.js (JXA) 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.

Bug reports, feature requests

Please use GitHub issues to report bugs or request features. Alternatively, you can post in the Alfred Forum thread.

Licence, thanks

The workflow code and the bundled Alfred-Workflow and docopt libraries are all licensed under the MIT Licence.

The workflow icon was created by Jono Hunt.

The other icons are from Font Awesome by Dave Gandy, and released under the SIL OFL 1.1 licence.

alfred-appscripts's People

Contributors

deanishe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

alfred-appscripts's Issues

v. 2.1.0 throws 'Could not get frontmost application' error all the time

With version 2.1.0 of the workflow, summoning the workflow always results in the message 'Could not get frontmost application' being displayed. Prior versions did not have this issue for me.

I tried looking at the workflow's log, which did not contain any Interesting Info. So here's the log for All Information upon summoning the workflow:

Starting debug for 'AppScripts'

[STDERR: alfred.workflow.input.scriptfilter] 13:05:18 workflow.py:2140 DEBUG    Workflow version : 2.1.0
13:05:18 workflow.py:1543 DEBUG    Reading settings from `/Users/<myusername>/Library/Application Support/Alfred 2/Workflow Data/net.deanishe.alfred-appscripts/settings.json` ...
13:05:18 workflow.py:2401 DEBUG    Update check not due
13:05:18 appscripts.py:117 DEBUG    args : {u'--debug': False,
 u'--help': False,
 u'--quiet': False,
 u'--verbose': False,
 u'--version': False,
 u'<key>': None,
 u'<query>': u'',
 u'config': False,
 u'search': True,
 u'toggle': False,
 u'userpaths': False}
13:05:18 workflow.py:1778 DEBUG    Loading cached data from : /Users/<myusername>/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/net.deanishe.alfred-appscripts/__workflow_update_status.cpickle
13:05:18 workflow.py:2349 DEBUG    update_data : {u'available': False}
13:05:19 appscripts.py:344 ERROR    AppleScript error : dyld: Library not loaded: @rpath/libswiftAppKit.dylib
  Referenced from: /Users/<myusername>/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.A0303EFC-4372-4D2B-93D9-81BCF6BF968D/ActiveApp
  Reason: image not found
13:05:19 workflow.py:2331 DEBUG    Set last run version : 2.1.0
13:05:19 workflow.py:2176 DEBUG    Workflow finished in 0.232 seconds.
[INFO: alfred.workflow.input.scriptfilter] <?xml version="1.0" encoding="utf-8"?>
<items><item valid="no"><title>Could not get frontmost application.</title><subtitle /><icon>/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns</icon></item></items>

I'm using Alfred 2 v2.8.1 (425) on Mac OS X 10.10.5 (14F1021).

AppleScript sources and and links

This is still one of the best Alfred workflows out there but Ive seen few decent/useful AppleScript files floating around lately in the macOS community (lm a relative software noob and can't write them from scratch myself). Can anyone recommend links, sources or repos to find some?

Possible to have non-app specific applescripts be found and ran? i.e. define one or multiple folders to search for applescripts and no matter what app is frontmost, show all files in those folders and run/open/reveal?

Hope I am not missing something but I love this workflow but think it would be great to have a duplicate of the current version to run and test one-off scripts located in my ~/scripts/applescript folder and maybe ~/downloads folder for quick access with opening an editor... What am i missing that this is not already implemented or where is it implemented as you have covered all corners of this workflow. As always thank you and excellent work. Pleasure to use and learn from your shared workflows. Cheers!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.