Amiga.org

Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: robo-ant on January 31, 2009, 05:17:01 AM

Title: Solved: Passing filename to script through AmiDock?
Post by: robo-ant on January 31, 2009, 05:17:01 AM
Hi,

I want to be able to drag files onto an AmiDock icon and have an AmigaDOS script executed with the dragged file's filename as an argument.

Can it be done?

I have tried making the icon type "Tool", and I have tried making it a "Project" icon and using iconx.  Both of these run the script but it doesn't get the filename.

I'm running AmigaOS 3.9.

Thanks.
Title: Re: Passing filename to script through AmiDock?
Post by: motorollin on January 31, 2009, 08:56:35 AM
Does your script work if you run it from the shell and pass the parameters manually? E.g.:

execute myscript hd0:myfile

Also, have you tried a very simple script, something like this:

.key myvar
.bra {
.ket }

echo {myvar}


--
moto
Title: Re: Passing filename to script through AmiDock?
Post by: weirdami on January 31, 2009, 11:27:41 AM
Quote

motorollin wrote:

.bra {
.ket }



Hey, this is not the quantum physics forum!


 :-P
Title: Re: Passing filename to script through AmiDock?
Post by: robo-ant on January 31, 2009, 11:39:21 PM
Quote

Does your script work if you run it from the shell and pass the parameters manually?


Yes, it does.  It also works if I click on the file, and then double-click on the script's icon on Workbench.

I would rather not have this icon on Workbench, but on AmiDock, where I could just drop files onto it.

Maybe SnoopDOS will be my friend.
Title: Solved!
Post by: robo-ant on February 01, 2009, 05:07:02 AM
OK, I have it working now.

What fixed it was changing the "Start from:" setting in the icon from "Shell" to "Workbench".

I don't know what the difference actually is, but it has solved the problem.