deanishe Posted December 27, 2015 Author Share Posted December 27, 2015 No to both questions, I'm afraid.(1) is beyond the scope of the workflow.(2) Alfred already does that (but I prefer FastScripts). Link to comment
deanishe Posted November 12, 2016 Author Share Posted November 12, 2016 Update to v3.0. Should now run much faster. Alfred 2 is no longer supported, however. Link to comment
johnyull Posted November 11, 2017 Share Posted November 11, 2017 Can't live without this workflow, but when I got a new MacBook I get the "alfred error in workflow permission denied er 13" message. It still works on my other computer using the same Alfred preferences in Dropbox sync. Is this folder permission issue. My Scripts folders seem to be both read/write permissible. Link to comment
deanishe Posted November 11, 2017 Author Share Posted November 11, 2017 5 minutes ago, johnyull said: Is this folder permission issue. No idea: you're not giving me anywhere near enough information to work with. Please follow the instructions in the Reporting Problems with Workflows sticky. Link to comment
johnyull Posted November 11, 2017 Share Posted November 11, 2017 This has happened with a few Alfred Workflow, including my favorites, Appscripts, Menu items, Window Switcher etc. Upon upgrading my new MacBook Pro and syncing Alfred with my old Mac via shared Alfred preference file in Dropbox , the old Mac continued running workflows just fine. I solved the new problem simply by re-downloading this and other workflows. So, it works fine right now. This seems to be a larger question about the sync function. For instance my new Mac, when searching brings up every possible item/element of all my Alfred workflows (Preference file in Dropbox) including every single (.jason, .py, , png etc.) where as my other computer does not. I realize this does not relate to your workflow but there is clearly a dropbox sync issue, that lead me to believe mistakenly it was your workflow. Sorry about that. Link to comment
gcao Posted November 14, 2017 Share Posted November 14, 2017 This is a very useful workflow. However where do I find useful scripts for the apps? Are you guys all writing them by yourselves? Link to comment
deanishe Posted November 14, 2017 Author Share Posted November 14, 2017 5 hours ago, gcao said: Are you guys all writing them by yourselves? Sometimes. Most of my own scripts are copied (or cobbled together from snippets) from forums/websites relating to the specific application. Link to comment
Qique Posted November 2, 2018 Share Posted November 2, 2018 Hi, just discovered the workflow (great work!) and installed. The problem I'm having is that it doesn't show me only the scripts for the active application, but shows me all scripts I have... I'm running under Mojave (10.14) and use Alfred3. What am I doing wrong? Can somebody help? Thanks in advance! Link to comment
deanishe Posted November 2, 2018 Author Share Posted November 2, 2018 1 hour ago, Qique said: Can somebody help? Use the "Edit Script Directories" option, as described in the instructions. Link to comment
Qique Posted November 2, 2018 Share Posted November 2, 2018 Thanks for the reaction deanishe, but after I have done that, I keep getting the message "no scripts for Alfred 3"... My directories are configured as follows: ~/Library/Scripts/Applications/{app_name} ~/Library/Scripts/Applications/{bundle_id} ~/Library/Application Scripts/{app_name} ~/Library/Application Scripts/com.omnigroup.OmniFocus3.MacAppStore ~/Library/Application Support/DEVONthink Pro Office/Scripts ~/Library/Application Support/{bundle_id}/Scripts ~/Library/Containers/{bundle_id}/Data/Library/Application Support/{app_name}/Scripts What am I still doing wrong? Thanks for the continued support. Link to comment
deanishe Posted November 2, 2018 Author Share Posted November 2, 2018 6 minutes ago, Qique said: What am I still doing wrong? I don't know. It shouldn't be possible to get Alfred as the active app. What does the debugger say? Have you followed the instructions for Mojave? Link to comment
Qique Posted November 9, 2018 Share Posted November 9, 2018 Apologies for the late response. Busy at work this week ? Yes, I have followed the Alfred instructions.... When I just opened the appscript instruction I saw an update available, which I applied. When I now run the .as command I do see the Omnifocus scripts but don't see the DEVONthink ones... And I see the Omnifocus scripts even when OmniFocus isn't active... So, I just don't know anymore.... When I run with debugger, the script considers Alfred as the frontmost app, while I have changed to working for example to Omnifocus.. Makes sense because I am switching to Alfred when I activate the script.... Link to comment
Qique Posted November 9, 2018 Share Posted November 9, 2018 Next update: I have now hardcoded the app_name and bundle_id again in the directory list, and I do see the scripts now, but again I see them always. So back to the challenge of only seeing the scripts of OmniFocus when working in OmniFocus, or DevonThink when I am working with DT... Link to comment
deanishe Posted November 9, 2018 Author Share Posted November 9, 2018 6 minutes ago, Qique said: Makes sense because I am switching to Alfred when I activate the script.... Alfred should never be the active app. That's the way it's designed. It used to have an alternate mode where it did become the active app (it helped with multiple monitors), but that option seems to now be gone (perhaps @Andrew can confirm). Have you tried setting the Hotkey in the workflow and running it that way? (I use ^⌘A). Just now, Qique said: I do see the scripts now, but again I see them always You will if you've hardcoded a value. 16 minutes ago, Qique said: When I run with debugger, the script considers Alfred as the frontmost app Please post the full debugger output. Link to comment
Andrew Posted November 10, 2018 Share Posted November 10, 2018 11 hours ago, deanishe said: Alfred should never be the active app. That's the way it's designed. It used to have an alternate mode where it did become the active app (it helped with multiple monitors), but that option seems to now be gone (perhaps @Andrew can confirm). Alfred still has the focus compatibility mode in Appearance > Options, but it's very rare that compatibility mode is needed these days (if you're up to date with macOS). Setting this option to "Compatibility Mode" in Alfred will make Alfred the front most (focused) application in macOS while Alfred's window is visible. Link to comment
deanishe Posted November 10, 2018 Author Share Posted November 10, 2018 2 hours ago, Andrew said: Alfred still has the focus compatibility mode in Appearance > Options @Qique check this setting in Alfred Preferences > Appearance. The Options button is at the bottom-left of the window if you, like me, couldn't find it (I was looking in the Advanced tab). Link to comment
h2ner Posted February 19, 2022 Share Posted February 19, 2022 Hello, i often use this daily. Having trouble with the Monterey change and removal of Python 2. I’ve tried to update it myself without success so far. If an update is possible sometime, that’d be much appreciated. Link to comment
vitor Posted February 20, 2022 Share Posted February 20, 2022 @h2ner Follow the knowledge base article then try this version. Untested but changes just enough that if should keep working. If it auto-updates, it should still detect updates to the official version. Link to comment
h2ner Posted February 20, 2022 Share Posted February 20, 2022 Works wonderfully. Thank you. Link to comment
TomBenz Posted October 2, 2022 Share Posted October 2, 2022 I use this great workflow to run my own AppleScript. In some applications script folder, I have sub-folder that has the scripts. How can this script be modified to a) search for these folder name b) include content of sub-folders when searching for script. I briefly looked at appscripts.py that is used for search. It has line that sets the folder and can possibly be updated to include sub-folder: DEFAULT_PATHS_FILE = os.path.join(os.path.dirname(__file__), 'Script Directories.default.txt') Is the workflow still maintained? @deanishe @vitor for your kind response please. Link to comment
vitor Posted October 2, 2022 Share Posted October 2, 2022 @pankajsz Don’t jump into script editing, read the instructions (top post). That file isn’t the directory, it lists them and is editable. Link to comment
TomBenz Posted October 2, 2022 Share Posted October 2, 2022 2 hours ago, vitor said: @pankajsz Don’t jump into script editing, read the instructions (top post). That file isn’t the directory, it lists them and is editable. Thanks @vitor Got Script Directories.default.txt instead of one mention in the instructions: #-------------------------------------------------------------------- # Script Directories #-------------------------------------------------------------------- # These directories will be searched for scripts. # # Files in these directories with extension .applescript, .scpt, # .scptd or .js will be shown in results. # # Empty lines and lines starting with # will be ignored. # # Environmental variables and ~ will be expanded, so # $HOME/Scripts and ~/Scripts will both expand to the "Scripts" # directory in your home folder. # # In addition {app_name} and {bundle_id} will be replaced with # the name and bundle ID of the currently active application. # # For example, if Safari is the active application, # "~/Scripts/{app_name}" will be expanded to # "/Users/username/Scripts/Safari" # # If you want certain scripts to be shown for *every* application, # specify a path without {app_name} or {bundle_id} in the path. # This will then always match. #-------------------------------------------------------------------- # Default directories #-------------------------------------------------------------------- ~/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 #-------------------------------------------------------------------- # Custom directories #-------------------------------------------------------------------- I can add path to show for *every* application through this. My request is for including sub-folder under {app_name}: ~/Library/Scripts/Applications/{app_name}/Sub-folderA ~/Library/Scripts/Applications/{app_name}/Sub-folderB and gather it dynamically. I can move all scripts into {app_name} folder itself by removing sub-folder but it becomes difficult to read and manage more than 10-15 files. thanks for your time Link to comment
vitor Posted October 2, 2022 Share Posted October 2, 2022 Do in a Terminal find -type d ~/Library/Scripts/Applications and you’ll get a nice list with all subdirectories. This one has been going for years without subdirectory support and is unlikely to change for now. There might be a reason the support isn’t there (e.g. hurting performance). Link to comment
TomBenz Posted October 3, 2022 Share Posted October 3, 2022 1 hour ago, vitor said: Do in a Terminal find -type d ~/Library/Scripts/Applications and you’ll get a nice list with all subdirectories. This one has been going for years without subdirectory support and is unlikely to change for now. There might be a reason the support isn’t there (e.g. hurting performance). Ok and thanks @vitor I will try this. If I add manually then the scripts will be available in all applications instead of just that specific applications? Number of Sub-directories is limited so performance is unlikely to get affected, I think. Is @deanishe original owner of this workflow still active? Link to comment
TomBenz Posted July 2, 2023 Share Posted July 2, 2023 On 10/3/2022 at 5:02 AM, vitor said: Do in a Terminal find -type d ~/Library/Scripts/Applications and you’ll get a nice list with all subdirectories. This one has been going for years without subdirectory support and is unlikely to change for now. There might be a reason the support isn’t there (e.g. hurting performance). @vitor -- request for help to include sub-folder. The Python code is too long for me to understand and modify it correctly. Here is the chatGPT three suggestions that I tried but couldn't make it work To modify the code so that scripts stored in sub-folders are also included, you need to make changes in the _get_scripts_for_app method. Here are the modifications you can make: Replace the line: pythonCopy code log.debug('loading scripts from `%s`...', scriptdir) with: pythonCopy code log.debug('recursively loading scripts from `%s`...', scriptdir) Replace the line: pythonCopy code for filename in os.listdir(scriptdir): with: pythonCopy code for root, _, filenames in os.walk(scriptdir): for filename in filenames: Replace the line: pythonCopy code path = os.path.join(scriptdir, filename) with: pythonCopy code path = os.path.join(root, filename) By making these modifications, the code will recursively traverse the script directory and include scripts from all sub-folders as well. 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