I'm trying to send a new e-mail message (without the file) when conditions are met. Then just press CMD-V to paste the file path into a new message.
this is my Hazel rule

for the last step "Run AppleScript" I found this on MacScripter
- Code: Select all
tell application "Finder" to set these_items to selection
try
set macPath to POSIX path of (item 1 of these_items as alias)
set the clipboard to srchRep(macPath, "/", "\\")
end try
on srchRep(theStr, fndStr, repStr)
set atid to AppleScript's text item delimiters
set AppleScript's text item delimiters to {fndStr}
set tempList to text items of theStr
set AppleScript's text item delimiters to {repStr}
set theStr to tempList as string
set AppleScript's text item delimiters to atid
return theStr
end srchRep
It works from Scripter Editor but not from Hazel itself. In my System Pref. I enabled "Full Disk Access" and "Accessibility" for Hazel.
Thanks for any suggestions!