Jump to content

How to compress folder of snippets


Recommended Posts

I exported somebody else's large list of snippets in order to edit them. I decompressed the snippets file and ran a batch edit on the individual json files. I tried compressing to zip and to tgz and renaming to *.alfredsnippets. When I import it the file is empty of snippets.

 

Is there a way to do what I need? I wanted to strip out the leading and trailing spaces from the CommonMisSpelling snippet pack created by user raguay.customct.

Link to comment

I suspect when you are re-compressing, you are keeping the parent folder containing json files, rather than just a zip of json files.

 

The easiest way to zip in a format compatible with Alfred directly from Finder is to go into the folder, select all the json files, right click and select "Compress x items". You can then rename the .zip to .alfredsnippets.

 

If you'd like to compress from the command line, Alfred uses the following:

ditto --norsrc -ck SnippetsSrcFolder CollectionName.alfredsnippets

Where SnippetsSrcFolder is the folder containing all the json files.

 

Hope this helps :)

 

Cheers,

Andrew

Link to comment

I suspect when you are re-compressing, you are keeping the parent folder containing json files, rather than just a zip of json files.

 

Your assumption was correct. I have now successfully compressed and imported. Thank you.

Link to comment
  • 2 months later...

I suspect when you are re-compressing, you are keeping the parent folder containing json files, rather than just a zip of json files.

 

The easiest way to zip in a format compatible with Alfred directly from Finder is to go into the folder, select all the json files, right click and select "Compress x items". You can then rename the .zip to .alfredsnippets.

 

If you'd like to compress from the command line, Alfred uses the following:

ditto --norsrc -ck SnippetsSrcFolder CollectionName.alfredsnippets

Where SnippetsSrcFolder is the folder containing all the json files.

 

Hope this helps :)

 

Cheers,

Andrew

Hi Andrew, I find out in each .json file there is a "uid" prop, what's the use of "uid"? How can I generate the uid? Can I generate the uid on my own thougth some kind of program?

 

Look forward to your reply

 

mixj93

Edited by mixj93
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...