alfred-datetime-format-converter
alfred-datetime-format-converter copied to clipboard
For anyone still using this after macOS 12.3
Apple removed the system python 2. I use this workflow all the time and needed to bring it back. Here's what I did.
First get python 2 back
# Download/run the legacy macOS installer (pick which one for your sys)
https://www.python.org/downloads/release/python-2716/
# Add pip for python2.7
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip2.py
python2 get-pip2.py
# Add the missing macos plist lib alfred uses
curl https://raw.githubusercontent.com/python/cpython/2.7/Lib/plistlib.py -o /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py
# Add missing pip for this workflow
python2 -m pip install delorean
# Optionally add the helpers like easy_install back onto your path
# In your ~/.zprofile or whatever bash/shell profile equivalent
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
Now open alfred preferences > Workflows > double click on the script filter square in the workflow GUI Update the script filter to one of the two below.
If which python
shows 2.7
/usr/local/bin/python process.py "{query}"
If which python
shows 3...
/usr/local/bin/python2 process.py "{query}"
For more legacy python2 help I wrote an SO post: https://stackoverflow.com/a/71513250/786389
I used pyenv to install python 2.7 now using:
/Users/username/.pyenv/versions/2.7.18/bin/python2.7 process.py "{query}"
works. Before I linked to a python2 version which was installed with MAMP, but that did not work.
Anyway, thanks for the tip!
@philotas thx, it works. More details are below:
- Install pyenv and python2.7
brew install pyenv
pyenv install 2.7.18
- Change the script to
$HOME/.pyenv/versions/2.7.18/bin/python2.7 process.py "{query}"
I created a Python 3 compatible fork here: https://github.com/alexmerkel/alfred-datetime-format-converter
I created a Python 3 compatible fork here: https://github.com/alexmerkel/alfred-datetime-format-converter
Can you supported millisecond level and add a default date time about UTC time zone when used other time zones? Thank you so much
Thanks to a pull request by @fg6a5gf this functionality is added now.