ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

seeking something to replace and rename files by drag 'n' drop

<< < (2/2)

jgpaiva:
Well.. Here you go!

code inside
--- ---;
;By jgpaiva
;date: June 2007
;Function:

Gui,  show, x100 y100 w200 h50 , Old File
Gui,2:show, x400 y100 w200 h50 , New File
Gui,  add,text,Vtext1, -No File-
Gui,2:add,text,Vtext2, -No File-
Gui,  +resize
Gui,2:+resize
file1 :=
file2 :=
return

guidropfiles:
  if A_EventInfo <> 1
    return

  file1 := A_GuiEvent
  GuiControl,1:text, text1, %file1%
  GuiControl,1:move, text1, W300
  if file2 =
    return

  msgbox,Now moving

  filerecycle,%file1%
  filemove,%file2%,%file1%,0
  file1 :=
  file2 :=
  GuiControl,1:text, text1, -No File-
  GuiControl,2:text, text2, -No File-
  msgbox,done
return

2guidropfiles:
  if A_EventInfo <> 1
    return

  file2 := A_GuiEvent
  GuiControl,2:text, text2, %file2%
  GuiControl,2:move, text2, W300
  if file1 =
    return

  msgbox,Now moving

  filerecycle,%file1%
  filemove,%file2%,%file1%,0
  file1 :=
  file2 :=
  GuiControl,1:text, text1, -No File-
  GuiControl,2:text, text2, -No File-
  msgbox,Done
  return

GuiClose:
2GuiClose:
  exitapp
  
f2::reload


As usual, just copy to a text file, name it as "whatever.ahk" and run it :)

A few important details:
- There are a few msgboxes that can you probably won't like, because they break the workflow. If so, just delete the lines with "msgbox".
- The order isn't relevant, as long as you drop the files on the correct GUIs.
- If you decide to keep the boxes, you can cancel the move operation by selecting "exit" from the tray menu before pressing ok on the first box.

THIS IS IMPORTANT: if you remove the message boxes, there's no way to cancel the operation. Still, the old file will be moved to the recycle bin.

[edit] Here's the source in a .ahk file:  and the compiled version: [ Invalid Attachment ] [/edit]

nudone:
fantastic work, jgpaiva.

as i use the revolutionary and always astounding, dialogmove, i don't mind the message boxes appearing  ;) but i may remove them in a minute.

i have named the script "bodysnatcher" as a tribute to the movie "invasion of the bodysnatchers" as this pretty much describes the process that happens to the files.

cody will send you something in a minute.

many many thanks.

jgpaiva:
as i use the revolutionary and always astounding, dialogmove, i don't mind the message boxes appearing  ;) but i may remove them in a minute.-nudone (June 27, 2007, 08:15 AM)
--- End quote ---
;D ;D

i have named the script "bodysnatcher" as a tribute to the movie "invasion of the bodysnatchers" as this pretty much describes the process that happens to the files.-nudone (June 27, 2007, 08:15 AM)
--- End quote ---
Now that's a catchy name :P
I love when people come up with names for the programs i make. Finding the right name is half the effort. At least for me ;)

cody will send you something in a minute.-nudone (June 27, 2007, 08:15 AM)
--- End quote ---
many many thanks.
-nudone (June 27, 2007, 08:15 AM)
--- End quote ---
No... Thank you!!

Navigation

[0] Message Index

[*] Previous page

Go to full version