Here is a script which I use daily.
Must be saved as an application.
#=====
# Code executed when we double click the app's icon
on run
set _ to choose file with prompt "Choose a file …"
my TraiteLeFichier(_)
end run
#=====
on open sel # sel is the list of aliases dropped upon the app's icon
my TraiteLeFichier(sel's item 1)
end open # fin 2
#=====
on TraiteLeFichier(zefile)
try
set leChemin to zefile as text
set the clipboard to (quote & leChemin & quote)
on error MsgErr number NroErr
if NroErr is not -128 then
beep 2
tell application "Finder" to ¬
display dialog "" & NroErr & " : " & MsgErr with icon 0 ¬
buttons {"Oops"} giving up after 20
end if
return
end try
end TraiteLeFichier
#=====
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) dimanche 2 février 2020 22:36:09