0

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

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
sealfab
  • 489
  • 2
  • 6
  • 10

1 Answers1

0

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. 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

user3439894
  • 7,266
  • 3
  • 17
  • 28
pbell
  • 2,965
  • 1
  • 16
  • 13