Это видео недоступно.
Сожалеем об этом.
Rapid Logging with Alfred and Python! Developer Productivity Tips
HTML-код
- Опубликовано: 23 дек 2022
- I use Alfred and Python to quickly log my day
You can download this workflow here -
kjaymiller.azu...
You can review the python code in this gist -
gist.github.co...
For help with Python datetimes -
docs.python.or...
For those using Raycast, you can achieve the same with the following instructions via builtin features:
1. Open Raycast (for me Command Spacebar) then open the settings (or just get to settings however you want, I like to use Command comma (,) to do it)
2. Choose Extensions
3. Then either click on + or command N for new script
4. Select Create Script Command and choose the Python template
5. The other settings you can fiddle with if you know what you're doing. I created a title for it, so you can find it by searching, a description so you know what to do/expect, and left everything else blank. I believe Package Name would be for any non-standard libraries. Lastly, make sure With Argument is checked. Edit: All of these get saved in the resulting file (Python in this case, but it could be shell, etc depending on the template chosen). It is all saved at the top of the file as comments.
6. Command Return or Command Enter (or enter depending on your keyboard) should name the script whatever you named the title (with dashes - for spaces) and a .py extension and ask you where to save it. Choose whatever location fits, I chose my Development/PyDev directory.
7. Open that newly created script with your favorite editor or IDE. I'm sure Jay would approve of VSCode in this case! 🙂Paste in the code he gave you after the comments, modifying it however you want/how Jay suggested in the video.
8. Now go back into Raycast however you invoke it and back to the extensions (command comma for me) and now you should now be in a screen with the new script listed. You can now assign a key by typing whatever you want in the alias section of the row. I chose l like Jay did for Alfred. Edited to correct the hotkey description: There is also a hotkey option which takes you to Raycast with the textfield focused which is actually nice. Hit esc two times to get out of Raycast.
9. Now whenever you invoke Raycast, command spacebar in my case, you can type l (el) and then it'll give you a textfield with a prompt beneath it to type in your content. The rest will use the same Python script from this video that you modified in Step 7.
Notes: Make sure you create the python script via Raycast and not separately as it puts some comments at the top to be used when you invoke the script so the argument gets passed. Also, it looks for python3 in your environment, so make sure your path has python3 or you've aliased python to python3. This was tested on a 14" Macbook Pro M1 Pro processor.
Hope this helps someone!