lawlist
lawlist

Reputation: 13457

How to preview file contents from command line, instead of Finder.app

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.

Upvotes: 3

Views: 371

Answers (1)

adayzdone
adayzdone

Reputation: 11238

From AppleScript:

set myFile to "/Users/lawlist/Desktop/test.jpg"
do shell script "qlmanage -p " & quoted form of myFile & ">& /dev/null"

Upvotes: 2

Related Questions