Jump to content

Making Python 2 Workflows work on macOS Monterey 12.3 and above


Recommended Posts

What’s the output of which python3?

 

1 minute ago, Slava said:

won't install for reasons unknown

 

I bet that’s your M1. You have to use the full path: /opt/homebrew/bin/brew. When you finished installing, Homebrew must’ve given you further instructions. The best way to not have to do that is to go into your shell’s startup files (if you don’t know what that is, in a terminal run open -t ~/.zshrc to edit the default.

  • On the M1, add to that file (and save): eval "$(/opt/homebrew/bin/brew shellenv)"
  • On the Intel, add to that file (and save): eval "$(/usr/local/bin/brew shellenv)"

Then restart your terminal (or open a new window) and you’re good to go.


While you’re at it, do a brew install python3 as well, as some Workflows might expect it.

Link to comment
On 5/20/2022 at 2:08 PM, vitor said:

Are you certain you downloaded and installed the versions from the table? Also, why not use the listed alternatives? That’s the recommended option. For Convert there’s CalculateAnything (you may need to brew install php) and for PowerThesaurus there’s a direct fork which updates it to Python 3 and SynAnt.

 

I have updated  alfred-convert  to Python3. Let me know if you see anything out of place. 

Thanks to NorthisUp and jun6lee for their work on the Workflow library. 

 

Link to comment

Hello:

 

I'm having a problem with the Password Generator workflow here: https://github.com/alfredapp/updated-third-party-python2-workflows/raw/main/Workflows/Password Generator.alfredworkflow.

 

I'm using macOS Monterey 12.4 and Alfred 4.6.6. I installed Python 2.7.18. My other workflows that were no longer working are once again working.

 

When I try to capture a password, I see the notification that it has been copied to my clipboard. However, it apparently doesn't because it never shows up when I try to paste. I use CMD+V but it doesn't actually paste what I've copied; instead it pastes whatever I pasted prior to this copy attempt.

 

I'm using a Lipsum workflow that pastes from Alfred and that has been working fine since I installed Python.

 

Any ideas? Thank you in advance!


Coping and pasting using other workflows works fine so I think it's possibly a problem with the workflow. I contacted the developer but he never responded.

Do you think I'm just doing something stupid? I realize you can't be expected to support workflows, but I'm just curious if there's something obvious I'm missing.

Edited by vitor
Normalised font size and colour
Link to comment
  • 2 weeks later...

Welcome @sephrioth,

 

2 minutes ago, sephrioth said:

can you help to make these workflow working in python3

 

These are not updated to work with Python 3; they’re fixed to work with Python 2 after the removal. You still have to install it.

 

5 minutes ago, sephrioth said:

 

Added.

 

7 minutes ago, sephrioth said:

 

Added.

Link to comment
43 minutes ago, pankajsz said:

Is it possible to get Python equivalent code for below or make this work?

 

That’s Perl. Different language. Unfortunately that one is quite old and has broken screenshots so it’s not all clear what it did. I’d be willing to look into a Regex Workflow in a few weeks time if there’s interest, but I’d need a guideline of what exactly people would want from such a Workflow.

 

4 minutes ago, ddmnr said:

 

Welcome @ddmnr,

 

Added.

Link to comment
On 6/13/2022 at 11:43 PM, vitor said:

 

That’s Perl. Different language. Unfortunately that one is quite old and has broken screenshots so it’s not all clear what it did. I’d be willing to look into a Regex Workflow in a few weeks time if there’s interest, but I’d need a guideline of what exactly people would want from such a Workflow.

 

 

Welcome @ddmnr,

 

Added.

Thanks Vitor. I will put few points together or some workflows that I find interesting related to regex

 

Possible to make this work?

https://pacmax.org/git_repo/jeeftor-alfredairports/

 

https://pacmax.org/git_repo/otherguy-alfred-airports-workflow/

 

 

Link to comment
On 6/16/2022 at 12:38 AM, vitor said:

 

Added the first one. You should also consider asking the creator to port it to Python 3. They made EmojiTaco and that one has been officially updated.

Thanks Vitor. Any guidelines on steps used to fix these? I add  export PATH=/opt/homebrew/bin:/usr/local/bin:${PATH}and make changes to .py header file to point to new location but find it difficult to go beyond it. Is it possible to get the 2nd one as well?

 

Few related questions (you can also advise right place to post such queries): 

1. Is there a way to find all installed workflows on your machine that uses Python so that one can check them once

2. Any workflow to find password protected excel in macOS? I can find protected pdf as kind:pdf -kMDItemSecurityMethod:None 

3. Fuzzy search that can search files by multiple tags in one go

4. Onedrive doesn't sync tag -- how can one export this info so that it is possible to migrate machines more comfortably?

5. Pause Onedrive workflow for 2 / 8 hours - some existing script uses GUI scripting but can't click on second level

 

btw, I have tried searching and reading existing threads on few of these items but couldn't get clear answers. Thanks in advance for your time and help.

Link to comment
5 hours ago, pankajsz said:

Any guidelines on steps used to fix these?

 

It isn’t hard to understand, but it’s not simple to explain all the steps either because not every Workflow is built the same. The process is fairly straightforward, but not to the point that everything is automatable. It’s a matter of grasping the Unix environment and adapting the Workflow to the changes (Apple’s removal of a binary in a specific location).


You add PATH; don’t need to change the script shebang unless it’s called without python (rare); update the python library if present; change every reference of /usr/bin/python to python.

 

5 hours ago, pankajsz said:

Is it possible to get the 2nd one as well?

 

There you go. But I won’t add it to the table because it’s a repeat of another. The goal of the repo is not to promote usage of Python 2 Workflows.

 

5 hours ago, pankajsz said:

1. Is there a way to find all installed workflows on your machine that uses Python so that one can check them once

 

No easy reliable way without getting a bunch of false positives (Python 3 Workflows). You can narrow it down by doing a search with something like ripgrep.

 

As to your other questions, I don’t use Excel or OneDrive so can’t say or test. If you’re finding Workflows which use GUI scripting for the OneDrive app, chances are it doesn’t support proper automation. If they fail to go all the way, you should ask the creators who have already made progress towards the goal. If you find a way to do it programmatically (there might not be one, in which case you need to ask the OneDrive team to implement it), we can help you make it work in a Workflow.

Link to comment

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...