Applescript Droplet: Neep Help Moving Files

Discussion in 'Mac Programming' started by jacktabby, May 3, 2010.

  1. jacktabby macrumors newbie

    jacktabby

    Joined:
    Feb 7, 2010
    Location:
    Australia
    #1
    I am making an applescript droplet that does the following:
    You drag a file to it and it moves it the this folder: /Users/Jack/.Trash

    This is my script so far:

    on open the_Droppings
    display dialog "Are You Sure You Want Move The Dropped Item(s) to the Trash?" buttons {"Yes", "No"}
    if the button returned of the result is "Yes" then


    else
    quit application
    end if
    end open


    I don't know what to type after:
    if the button returned of the result is "Yes" then

    I was thinking along the lines of:
    tell application "Finder"
    move dropped files to "/Users/Jack/.Trash"
    end tell


    Thank you for taking the time to read my post and hopefully you can help.

    P.S. Please don't give me the move to trash command. I want to do it like this for a reason. Thanks. :)
     
  2. mysterytramp macrumors 65816

    mysterytramp

    Joined:
    Jul 17, 2008
    Location:
    Maryland
    #2
    Code:
    on open the_Droppings
    	display dialog "Are you sure you want to move the dropped item(s) to the trash?" buttons {"Yes", "No"}
    	if the button returned of the result is "Yes" then
    		tell application "Finder" to move the_Droppings to the trash
    	end if
    end open
    mt
     
  3. numero macrumors regular

    Joined:
    Jul 23, 2002
    Location:
    OR
    #3
    Here's your way of doing it without the "move to trash" command.

    Code:
    repeat with a_Dropping in the_Droppings
    	do shell script "mv " & (quoted form of POSIX path of (a_Dropping as alias)) & " /Users/numero/.Trash/"
    end repeat
    I don't see any advantage to doing it this way? Why do you want to do this?

    -numero
     

Share This Page