Thanks. I tried the line you gave me above, but got compile errors... nevertheless, I did hack through this code that seems to work fine:
on alfred_script(q)
# Get selected file name from Finder
# ==================================
tell application "Finder"
set theItems to selection
--display dialog number of theItems
repeat with itemRef in theItems
--display dialog (get name of itemRef)
set file_name to (get name of itemRef)
--display dialog "file_name is " & file_name
end repeat
end tell
# the selection is now in var: file_name
# ======================================
--display dialog "file_name is " & file_name
set the var_ValueX to the file_name
set var_link to "[" & var_ValueX & "]" & "(<file:///Volumes/Drobo/linked_files/" & file_name & ">)"
set the clipboard to var_link
--display dialog var_link
end alfred_script
My problem in the workflow now is to move the file from it's location on the MAC to my hard drive. I was trying to set a workflow variable
from my applescript so I could read it into a bash script that would move the file, but I got stuck there too.
Allthough I used the same name for the variable (1) in my applescript, and (2) in the Workflow Environment Variables,
the variable value is not set by the applescript. ??
Maybe there is another way to fet the filename and then move it to "Volumes/Drobo/linked_files" ??