Jump to content

Sync macOS Text Snippets with Alfred Snippets


andy4222

Recommended Posts

Workflow that sync one way sync from macOS text snippets to Alfred snippets. (NOTE: Alfred's "macOS" snippets list is overwritten every time)

 

I created this workflow by modifying @deanishe 's script. Their script stopped working after python 3 migration so I made a few changes to make it work.

 

No forum post or github link as I don't upload any of my workflows (I'm lazy, sorry)

 

Need "python3" installed and added to the path

 

https://www.dropbox.com/s/iod0zplbd7i6kdj/Sync macOS Text Snippets with Alfred.alfredworkflow.zip?dl=0

Edited by andy4222
Link to comment
Share on other sites

10 hours ago, andy4222 said:

Workflow that sync one way sync from macOS text snippets to Alfred snippets. (NOTE: Alfred's "macOS" snippets list is overwritten every time)

 

I created this workflow by modifying @deanishe 's script. Their script stopped working after python 3 migration so I made a few changes to make it work.

 

No forum post or github link as I don't upload any of my workflows (I'm lazy, sorry)

 

Need "python3" installed and added to the path

 

https://www.dropbox.com/s/n1zgzxue7q12ks2/Snippets macOS snippets with Alfred with macOS.alfredworkflow.zip?dl=0

 

in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/Users/ankit'

 

Getting the following error in debugger log: See if you can check and update. it seems some path has got hard-coded.

Link to comment
Share on other sites

  • 5 weeks later...

Hrm, any ideas on this one? I'm running Ventura which is the Destroyer of Things We've Previously Enjoyed so may be that.

 

05:19:40.572] STDERR: Sync macOS Text Snippets with Alfred[Run Script] loaded 5 macOS shortcut(s)
exporting snippets to '/Users/user/Sync/Application Support/Alfred5/Alfred.alfredpreferences/snippets/macOS' ...
Traceback (most recent call last):
  File "/Users/user/Sync/Application Support/Alfred5/Alfred.alfredpreferences/workflows/user.workflow.754D43AA-91E3-4C11-9CEB-2195DCB32440/sync.py", line 117, in <module>
    main()
  File "/Users/user/Sync/Application Support/Alfred5/Alfred.alfredpreferences/workflows/user.workflow.754D43AA-91E3-4C11-9CEB-2195DCB32440/sync.py", line 113, in main
    export_shortcuts(shortcuts, dirpath)
  File "/Users/user/Sync/Application Support/Alfred5/Alfred.alfredpreferences/workflows/user.workflow.754D43AA-91E3-4C11-9CEB-2195DCB32440/sync.py", line 95, in export_shortcuts
    for name in os.listdir(dirpath):
PermissionError: [Errno 13] Permission denied: '/Users/user/Sync/Application Support/Alfred5/Alfred.alfredpreferences/snippets/macOS'

 

Link to comment
Share on other sites

  • 2 months later...

I can confirm the error on Ventura. There are also a couple of other issues, namely that the About has this weird section:

 

Inspired by deanishe's script at https://www.deanishe.net/snippet/macos-shortcuts-to-alfred-snippets/#:~:text=The%20default%20location%20(i.e.%20you,Application%20Support%2FAlfred%2FAlfred.

 

And the workflow has no icon or description. We can do without the latter, but an icon is necessary. https://font2png.com is a good source to make an icon quickly (make sure to have a non-transparent background with rounded corners).

Link to comment
Share on other sites

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