Open file in Quick Look?

Is there any way to view a file in Quick Look instead of opening a file in the application?

There is no Quick Look option available for Panorama databases. Since a database could contain thousands of pages of information, I’m not sure what a Quick Look option would show.

This sentence answers my question. Thank you.

Just guessing, but it might show something not included in the database. Same as when someone opens a file using openanything.

You can use the revealinfinder statement and then hit the space bar.

1 Like

I will try this. I appreciate your help. Thank you.

Thank you.

Now I’m thinking I misunderstood the original question.

What I thought you were asking was whether you could be in the finder, click on a Panorama database, and then press the space bar to see a thumbnail of the database. When I said I wasn’t sure what Quick Look would show, what I meant was that I didn’t really see how you could display a database in a thumbnail in a reasonable way.

Since you liked Kurt’s answer, now I’m thinking that your question was that you are keeping a path to a file in a database (maybe an image, PDF, etc.) and you want a way to display a Quick Look via a procedure. There is no way to do that, but it could be an interesting idea for the future.

1 Like

You can, in a dirty sort of way. This procedure prompts to choose a file from the desktop then uses qlmanage to display its quicklook for 5 seconds (if you don’t use click on close first). Obviously the path might already be in a field or variable anyway.

local Path
choosefiledialog Path,"initialpath","~/Desktop"
let QuickLook=posixtask('qlmanage -p "'+Path+'"')
delay 5
stopposixtask QuickLook

I looked into this a while ago and I’m sure I found a prettier command-line way of launching a quicklook without using qlmanage’s ugly grey window with ‘[DEBUG]’ in the title bar, but I can’t now remember what it was.

1 Like

I’ve found it: use the Shortcuts app to create a shortcut called Quick Look (its default name), using the action ‘Quick Look’ with its input set to ‘Shortcut input’. Then the following procedure will display a conventional quicklook rather than the [DEBUG] version:

local Path
choosefiledialog Path,"initialpath","~/Desktop"
let QuickLook=posixtask('shortcuts run "Quick Look" -i '+quoted(Path))
delay 5
stopposixtask QuickLook

The first time I ran it, on closing the quicklook window a privacy window appeared asking ‘Allow “Quick Look” to output 1 image?’. Clicking ‘Always Allow’ stops that appearing on subsequent occasions.

2 Likes

Thanks @KJM and @pcnewble – Both of these solutions work well. I can also use openanything to view a file in Quick Look but making an Apple Shortcut and saving it as an app.“openanything” allows me to run any Apple Shortcut, which opens many possibilities within PanX.

Thanks for your help.