DROP CLICK
Author Jon Visick
Message No.

http://groups.yahoo.com/group/power-pro/message/15059

File Name DropClick.powerpro
Requirements File Plugin
Assumptions & is "expression follows" character
Variables * AltPress (1 if Alt key is down; 0 if not)
* DropTarget (the drive or folder to open or copy to)
Description: A script used in conjunction with bar buttons intended to replace desktop icons. Allows buttons to have a different action when clicked vs. when a file is drag-and-dropped to it. Also allows a different action (e.g., move vs. copy) if Alt key is held during the drag-and-drop.
Notes:

There are two components:

(1) The Left command on the button is:
 
AltPress = alt
(AltPress = 1 if Alt key is down; 0 if not)

DropTarget = "e:\"
(DropTarget is the target drive or folder, so I can use a single script for all)

.DropClick
(Starts the script to handle the click or drag-and-drop; the equal sign is important because it sets flag x9 to the name of whatever file is being dropped or to "" if it's just a click; see Help under "Command Scripts"

(2) The DropClick.powerpro script used for all the buttons is:

If (x9 == "") do
    Exec Explorer &(DropTarget)
    ; If x9 is null, then no file is being dropped.
    ; This is interpreted as a simple click on the button and
    ; Explorer opens to show the desired drive/folder
Else
    ; If a file has been dropped on the button
    If (AltPress == 1) do
        file.move(x9,DropTarget)
        ; If the Alt key is held during the drag-and-drop,
        ; then move the file instead of copying it
    Else
        file.copy(x9,DropTarget)
        ; Copy the dropped file to the target
    Endif
Endif