Welcome, Guest. Please login or register.

Author Topic: Solved: Passing filename to script through AmiDock?  (Read 1283 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline robo-antTopic starter

  • Jr. Member
  • **
  • Join Date: Apr 2007
  • Posts: 87
    • Show only replies by robo-ant
Solved: Passing filename to script through AmiDock?
« 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.
 

Offline motorollin

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Passing filename to script through AmiDock?
« Reply #1 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
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline weirdami

  • Hero Member
  • *****
  • Join Date: Jan 2003
  • Posts: 3776
    • Show only replies by weirdami
    • Http://Bindingpolymer.com
Re: Passing filename to script through AmiDock?
« Reply #2 on: January 31, 2009, 11:27:41 AM »
Quote

motorollin wrote:

.bra {
.ket }



Hey, this is not the quantum physics forum!


 :-P
----
Binding Polymer: Keeping you together since 1892.
 

Offline robo-antTopic starter

  • Jr. Member
  • **
  • Join Date: Apr 2007
  • Posts: 87
    • Show only replies by robo-ant
Re: Passing filename to script through AmiDock?
« Reply #3 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.
 

Offline robo-antTopic starter

  • Jr. Member
  • **
  • Join Date: Apr 2007
  • Posts: 87
    • Show only replies by robo-ant
Solved!
« Reply #4 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.