简体   繁体   English

如何在 finder 中快速打开选定的文件

[英]How to open selected file in finder with quik look

I am making a script for processing receipts and would like to be able to select a file than trigger a keyboard maestro applescript action that opens the selected file in quicklook than on a different area of the screen run the script below so that the user can input the data while looking at the file我正在制作一个用于处理收据的脚本,并且希望能够 select 一个文件而不是触发一个键盘大师 applescript 操作,该操作在 quicklook 中打开所选文件,而不是在屏幕的不同区域运行下面的脚本,以便用户可以输入查看文件时的数据

display dialog "Date?" default answer ""
set response_date to text returned of result
display dialog "Payee?" default answer ""
set response_payee to text returned of result
set account_choices to {"Bank1", "Bank2", "Cash"}
set response_account to choose from list account_choices with prompt "Select Account:" default items {"Bank1"}
display dialog "Amount?" default answer ""
set response_amount to text returned of result
set filename to response_date & "-" & response_payee & "-" & response_account & "-" & response_amount & ".pdf"
display dialog filename

The shell command qlmanage with option -p followed by your file path activates the Quick Look feature, same as the space bar on the Finder.带有选项-p的 shell 命令qlmanage后跟您的文件路径可激活快速查看功能,与 Finder 上的空格键相同。 Example:例子:

Set myFile to "/HD/Users/me/Desktop/image.jpg"
do shell script "qlmanage -p " & myFile's quoted form

For more options, use Terminal with command: man qlmanage有关更多选项,请使用带有命令的终端: man qlmanage

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM