0
votes

trying to make an AppleScript droplet that moves a file to a given folder when the file is dragged to the droplet; not sure how to tell the script that the file I just dragged is the one I want to move; I tried this but it doesn't work:

on open dragged_file
  tell application "Finder"
  move dragged_file to "Macintosh HD:Users...etc."
  end tell
end open   --script runs but doesn't move file
2

2 Answers

1
votes

Try:

on open of theFiles
    tell application "Finder"
        move theFiles to folder "Macintosh HD:Users...etc."
    end tell
end open
0
votes

To use a droplet, you have to introduce a loop repeat with currentitem in draggeditem now your script And then end repeat for your exemple

on open dragged_file
 repeat with currentitem in dragged_file
  tell application "Finder"
  move dragged_file to folder "Macintosh HD:Users...etc."
  end tell
end repeat
end open   --script runs but doesn't move file