SOLVEd: Run applescript on matched file(s)

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

SOLVEd: Run applescript on matched file(s) Sun Sep 08, 2013 5:13 am • by PStehr
I have an applescript that works fine with an absolute path to the file that needs to be processed, but I need this script to run on matched files as an embedded applescript within Hazel.

The static/standalone script is:

Code: Select all
try
   set the clipboard to (read file "Users:username:folder:links.txt")
end try


I need to get this to work so that it replaces "Users:username:folder:links.txt" with the correct path to the file(s) matched by Hazel. I have tried to replace the absolute path with theFile and a multitude of other things that I thought noobyishly thought may work , but didn't.

I've searched the board (and other resources), but do not seem to be able to get this to work.

Any help would be appreciated.
PStehr
 
Posts: 4
Joined: Sun Sep 08, 2013 5:02 am
Location: Bangkok

Re: SOLVEd: Run applescript on matched file(s) Sun Sep 08, 2013 6:34 am • by PStehr
Solved by doing

Code: Select all
set fileContents to read theFile

set the clipboard to fileContents



Apparently I posted the question prematurely. Next time I'll be sure to search longer than 4 hours on the net for a solution.
PStehr
 
Posts: 4
Joined: Sun Sep 08, 2013 5:02 am
Location: Bangkok


Return to Support