edbro Posted July 2, 2016 Share Posted July 2, 2016 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
Andrew Posted July 3, 2016 Share Posted July 3, 2016 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 mixj93 1 Link to comment
edbro Posted July 3, 2016 Author Share Posted July 3, 2016 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
mixj93 Posted September 6, 2016 Share Posted September 6, 2016 (edited) 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 September 6, 2016 by mixj93 Link to comment
deanishe Posted September 6, 2016 Share Posted September 6, 2016 UID = Unique ID. It's an identifier and is inherently meaningless. It just needs to be unique. The uuidgen command-line program can generate them for you. Link to comment
mixj93 Posted September 7, 2016 Share Posted September 7, 2016 UID = Unique ID. It's an identifier and is inherently meaningless. It just needs to be unique. The uuidgen command-line program can generate them for you. Cool! Thanks Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now