Hi everyone,
I am trying to write an applescript where I can drop something onto a droplet, get it to copy the file path, open the shell, navigate to that directory, then have it create a text file on my desktop of the listed files. I have both parts figured out separately, but I cannot figure out how to bridge the two and get what's on the clipboard into the shell after the "cd" command.
Here's my script as it stands right now:
on open {dropped_item}
tell application "Finder" to set the clipboard to the dropped_item as text
(do shell script "cd" and paste) the clipboard
do shell script "ls */* | cat>>~/Desktop/filelist.txt"
end open
The part in bold is the part I can't figure out: taking the clipboard and pasting is into the shell after the "cd" command. Any help appreciated!
I am trying to write an applescript where I can drop something onto a droplet, get it to copy the file path, open the shell, navigate to that directory, then have it create a text file on my desktop of the listed files. I have both parts figured out separately, but I cannot figure out how to bridge the two and get what's on the clipboard into the shell after the "cd" command.
Here's my script as it stands right now:
on open {dropped_item}
tell application "Finder" to set the clipboard to the dropped_item as text
(do shell script "cd" and paste) the clipboard
do shell script "ls */* | cat>>~/Desktop/filelist.txt"
end open
The part in bold is the part I can't figure out: taking the clipboard and pasting is into the shell after the "cd" command. Any help appreciated!