justnp Posted January 15, 2020 Share Posted January 15, 2020 Short story, I backed up my Alfred workflows in my google drive, and now when I try to download them, they all come in form of zipped files. I've read here that you can convert the .alfredworkflow.zip file back into an .alfredworkflow file which I've managed to do but when I try to install the workflow, none of the workflows have their respective pictures saved (if I tried to do this manually for ~ 40 - 50 workflows, it would take ages). Any thoughts on how to easily fix this / automate this? I've tried writing a Python script but even using the subprocess module to run bash commands messes up the workflow when trying to zip the info.plist file. I'd greatly appreciate any thoughts on this and any ideas! Even after doing this and I try to install through info.alfredworkflow, it complains and gives a message "The workflow you are trying to import is invalid." I'm honestly not sure what to do at this point. import os import subprocess # SINGLE os.chdir("...") # change to directory that contains the .alfredworkflow.zip files for f in os.listdir(os.getcwd()): if len(f.split(".alfredworkflow.zip")) == 2: path = os.getcwd() + "/" + f subprocess.run(["unzip", path, "-d", os.getcwd() + "/" + f.split(".zip")[0]]) dirs = list(filter(os.path.isdir, os.listdir(os.getcwd()))) # ZIP for folder in dirs: if len(folder.split(".alfredworkflow")) == 2: path = os.getcwd() + "/" + folder + "/info.plist" subprocess.run(["zip", path + ".zip", path]) # RENAME for folder in dirs: if len(folder.split(".alfredworkflow")) == 2: path = os.getcwd() + "/" + folder + "/info.plist.zip" subprocess.run(["mv", path, os.getcwd() + "/" + folder + "/info.alfredworkflow"]) Link to comment
deanishe Posted January 15, 2020 Share Posted January 15, 2020 We can’t tell you how Google Drive has messed up your workflows without seeing at least one of the messed-up workflows. There are many things it might have done, including simply adding “.zip” to the filename (workflows are ZIP files, just with a different extension). justnp 1 Link to comment
justnp Posted January 15, 2020 Author Share Posted January 15, 2020 Wow, you were right. I just assumed that it was actually zipped since it was a .zip file. By just removing the .zip from the name of the file, that allowed for me to install it while keeping all of the images intact. Thank you! 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