Hi,
I have several .zip files that I need to create and upload so they can be downloaded later. Sometimes, I need to see what's inside without opening them. I used to use a quick look plugin from BetterZip, but that no longer works as I wanted it to. I have to install the app, but I don't want that.
So, I looked for an alternative and came across Glance in the App Store, but I could not see the items there.
I also saw some plugins that can show all sorts of things, so I thought it would be nice to have something like that in BTT.
Or is there already a way to create my own quick-look UI?
Unfortunately currently this is not possible. I looked into it a while ago, but it's not easy to create a generic extendable ql plugin
Ah, I see. That's too bad.
Thanks any ways
I've tried to do this, but it is not working, not sure why (maybe Andreas will have idea since I remember that using applescript with BTT is not always straight forward):
Running the script from Script Editor it is working and the result is:
probably need to use the full path to unzip. (/usr/bin/unzip)
Still not working. I can see the trigger in the "Recently used".
ah I just noticed you are showing a dialog, this won't work if you run the script in background. You need to use the non-background run apple script action
Well it seems there's something else, because it is still not working.
here's the code for easier copy/paste if you would like to test.
tell application "Finder"
set selectedItems to selection
if (count of selectedItems) is not 1 then
display dialog "Please select a single ZIP file." buttons {"OK"} default button "OK"
return
end if
set zipFile to item 1 of selectedItems
set filePath to POSIX path of (zipFile as alias)
set outputFilePath to POSIX path of ((path to desktop as text) & "unzip_output.txt")
end tell
set shellCommand to "/usr/bin/unzip -l " & quoted form of filePath & " > " & quoted form of outputFilePath
do shell script shellCommand
set fileContents to do shell script "cat " & quoted form of outputFilePath
display dialog "Unzip listing:
" & fileContents buttons {"OK"} default button "OK"
Seems to work fine here
Possibly try to close the BTT UI, it can sometimes interfere with apple script dialogs
Thank you Andreas. Issue was that BTT was not able to "control" other apps:
@Black_Simorgh , will this do the job?
Thanks for your help. I haven't tried it yet. I will try that and come back to you.
But it looks like the output is text-based. It would be nice to have some icons or at least formatted text so for example, the headline would be bold and underlined.
But I will give it a try.
Thanks
Ok,
I played with it a bit, and It showed me all the info. Maybe I could insert this in the shortcuts app and let it format the text. And then, I run this from the context menu.
I think this is, for the beginning, a good starting point.
Thanks
I can post an example on how to display this formatted in a BTT webview later.
Yeah,
That would be nice.
By the way, do you know if there is an option in the shortcuts app to get info on the content of a zip file?
i have no idea
I just found this video where he explains just what I'm trying to achieve in the shortcuts app. I think I will format the text further, but I found that helpful for now.
I tried to figure it out in the shortcuts App, but unfortunately, it is more complicated than I thought.
I set it up as close as possible to what I wanted it to be.
Using this shortcut:
But I can not figure out how to refine that more. I would like to have it something like this, and it should work with every amount of files or folders.
here is a very quick & dirty example of rendering something like this in a floating menu. It's triggered via cmd+opt+ctrl+L
quicklook.bttpreset (28.0 KB)
Hey @Andreas_Hegenberg,
Thanks for the preset. I tried it out, and it looks good, but I couldn't figure out how to edit the text or change, for example, the color. And how can I remove all the unnecessary text like "__MACOSX, .DS_Store, Name, ----"?
Also, is there a way to remove all the paths and only show the names of the files and folders?
I tried to take a screenshot of it, but whenever I did that, the window disappeared.
best ask chatgpt. I also just auto generated the code for the webview item
It can quickly modify it if you provide it some example output from unzip -l