Jump to content

creating directory

Recommended Posts

hi all

I can't get this to work if launched from Alfred. Works if run from Terminal. What am I missing? 


#!/usr/bin/env python

import os

if not os.path.exists(os.path.expanduser('~/Library/Application Support/Alfred/Workflow Data/myWorkflow')):
    os.mkdir (os.path.expanduser('~/Library/Application Support/Alfred/Workflow Data/myWorkflow'))


Link to post

thanks. nothing in the debugger (but I might not be redirecting errors to it?).

I tried the Python 3 solution and it's the same (works in Terminal, nothing in Alfred). 

I thought Python 2 was recommended if you wanted to share (for users on older systems), but perhaps it is time to switch? 



PS: that's what I get for not using your Workflow :D which has always created those directories seamlessly

Link to post
11 minutes ago, giovanni said:

I thought Python 2 was recommended if you wanted to share (for users on older systems)


Sure. But if you want a workflow that will continue to work on future systems, use Python 3.


Python 2 is dead. Regardless of any other qualities of the language, that makes it a questionable choice for new code.

Link to post

it didn't, but granting permission did not make a difference. Also, in Catalina Alfred is not even on the list of apps requesting Full Disk Access... and how has Workflow been doing it? I have been using Workflow on Big Sur for a while without issues... I will keep investigating. May I ask how to direct Python's error messages to Alfred's debugger? is it by adding >&2 somewhere? 

Link to post

for future reference: this seemed to be related to Google Drive, I was running this workflow from a symlinked folder in google drive (I know, it's a no-no :)).

From that same source it worked correctly on catalina and incorrectly on big sur. Works fine on both, if symlinked from a regular folder.

thanks again!


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...