Question

From a command-line in a terminal, is there any way to bring up the preview file contents screen that can be seen in Finder.app when pressing the spacebar -- without bringing Finder.app to the foreground with focus (i.e., keep Finder.app back-grounded). If so, can anyone please share with me the contents of an applescript (e.g., osascript) that will accomplish that goal.

Was it helpful?

Solution

From AppleScript:

set myFile to "/Users/lawlist/Desktop/test.jpg"
do shell script "qlmanage -p " & quoted form of myFile & ">& /dev/null"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top