Advertisement
Cerberus_tm

Cautomaton test script in Autohotkey

Sep 14th, 2014
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. !^+#v::  ;; When you hit alt-control-shift-win-V, the commands below are triggered.
  2. Sleep 500  ;; Remove this long sleep if the hotkey is triggered by a mouse gesture; it should only be needed if you type the hotkey by hand.
  3. Sleep 50
  4. Send {control up}{alt up}{rwin up}{shift up}
  5. ClipSave := ClipboardAll  ;; This saves whatever you have on your clipboard for later.
  6. Clipboard := ""
  7. Send {control down}  ;; Copy (control-C) whichever item you have selected in order to get the path of a folder, if present.
  8. Sleep 50
  9. Send c
  10. Sleep 50
  11. Send {control up}
  12. FilePath := Clipboard  ;; Here we take the path of the selected item from the clipboard in order to analyse it (folder or not?).
  13. FileGetAttrib, Attributes, %FilePath%
  14. If Instr(Attributes, "D") ;; If the selected item is a folder/directory, execute "paste" from the right-click menu, using Cautomaton.
  15. {
  16.     Clipboard := ClipSave
  17.     Run, D:\Programs\Cautomaton (0.9.0)\cautomaton32.exe /v paste `"%FilePath%`", , Hide  ;; Replace the part before "cautomaton32.exe" with the location of your Cautomaton file.
  18. }
  19. Else  ;; Do normal paste action, control-V.
  20. {
  21.     Sleep 50
  22.     Send {control down}
  23.     Sleep 50
  24.     Send v
  25.     Sleep 50
  26.     Send {control up}
  27. }
  28. Sleep 100
  29. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement