topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Wednesday December 11, 2024, 8:58 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: DropButton  (Read 5600 times)

JennyB

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 212
  • Test all things - hold fast to what is good
    • View Profile
    • Donate to Member
IDEA: DropButton
« on: January 22, 2007, 09:24 AM »
This is Drag and Drop Robot for non-power users.
It gets invoked by in association with a batch file.

Shows a stay-on-top icon with the file name as title.
Executes the file whenever a suitable item is dropped on it.
Goes away when you click it.

That's all.
If you don't see how it can fail -
you haven't understood it properly.

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: DropButton
« Reply #1 on: January 22, 2007, 11:21 AM »
 :) Here's DrOpen, an AHK script I think does what you ask!
To run, save as DrOpen.ahk and install AutoHotkey.

;DrOpen.ahk
; Drop files on a window to open the files in an associated program.
; Syntax: DrOpen "<command>"
; Example: DrOpen "c:\windows\notepad.exe"
;Skrommel @2007

xpos:=100
ypos:=0
width:=100
height:=0

#NoEnv
#SingleInstance,Off

SplitPath,1,name,dir,ext,name_no_ext,drive
Gui,+ToolWindow +AlwaysOnTop
Gui,Show,x%xpos% y%ypos% w%width% h%height%,%name_no_ext%
Return

GuiDropFiles:
ToolTip,%A_GuiControl%
Loop, parse, A_GuiControlEvent, `n
  Run,%1% %A_LoopField%
Return

GuiClose:
ExitApp
« Last Edit: January 22, 2007, 04:33 PM by skrommel »

JennyB

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 212
  • Test all things - hold fast to what is good
    • View Profile
    • Donate to Member
Re: IDEA: DropButton
« Reply #2 on: January 22, 2007, 04:26 PM »
:) Here's DrOpen, an AHK script I think does what you ask!
To run, save as DrOpen.ahk and install AutoHotkey.

How exactly are you invoking this?  I tested in a FARR alias "filepath1/DroPen.ahk filepath2/command" and it seems to read its own filepath1 and ignore filepath2. I get a window with the title "DroPen.ahk" when it should be the name of the command.


edited by jgpaiva: adding ]/quote[ tag
If you don't see how it can fail -
you haven't understood it properly.
« Last Edit: January 22, 2007, 04:40 PM by jgpaiva »

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: DropButton
« Reply #3 on: January 22, 2007, 04:33 PM »
 :tellme: Try creating a shortcut to DrOpen, right click it and select properties, and add the path to the program you want to run. You might want to enclose the path in "s.

Skrommel

;DrOpen.ahk
; Drop files on a window to open the files in an associated program.
; Syntax: DrOpen "<command>"
; Example: DrOpen "c:\windows\notepad.exe"
;Skrommel @2007

JennyB

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 212
  • Test all things - hold fast to what is good
    • View Profile
    • Donate to Member
Re: IDEA: DropButton
« Reply #4 on: January 23, 2007, 08:54 AM »
Same problem. Reads the firstfilepath, ignores the second.
If you don't see how it can fail -
you haven't understood it properly.

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: DropButton
« Reply #5 on: January 23, 2007, 12:27 PM »
 :tellme: If you just start DrOpen without any parameters, it will show a window with DrOpen, and start any dropped file in the associated application.

Anyone else get the same result as JennyB?

Skrommel