Please kindly let me know how to make the macro for below.
I want to open(popup such as quicklook) specified file like a txt or jpg for instant reference.
I don't want to open with it by text editor or photo viewer, want to see it by quicklook.
Thank you for your response.
I've tried it but I'm really beginner.
So I couldn't find how to designate a file.
I would appreciate if you could let me know how.
tell application "Finder"
set pathFile to selection as text
set pathFile to get POSIX path of pathFile
do shell script "qlmanage -p \"" & pathFile & "\""
end tell
Here it is in less simple form with more canonical AppleScript and basic error-checking.
-Chris
try
tell application "Finder" to set finderSelectionList to selection as alias list
if length of finderSelectionList ≠ 1 then
error "Problem with number of files selected in Finder!"
else
set filePath to get POSIX path of item 1 of finderSelectionList
set shCMD to "qlmanage -p " & quoted form of filePath
do shell script shCMD
end if
on error e number n
set e to e & return & return & "Num: " & n
if n ≠ -128 then
try
tell application (path to frontmost application as text) to set ddButton to button returned of ¬
(display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬
default button "OK" giving up after 30)
if ddButton = "Copy Error Message" then set the clipboard to e
end try
end if
end try