English Amiga Board


Go Back   English Amiga Board > Support > support.Apps

 
 
Thread Tools
Old 16 June 2021, 10:21   #1
Octopus66
Registered User
 
Join Date: Feb 2016
Location: London
Posts: 335
MenuTools OS 3.2 ToolsDaemon

I have been testing out MenuTools and can get it to launch programs without issue. Does anyone know if I can replicate the behavior of ToolsDaemon where you can click an icon and have a program interact with the selected file?
Octopus66 is offline  
Old 16 June 2021, 14:39   #2
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Yes, it is possible.
daxb is offline  
Old 16 June 2021, 17:10   #3
Octopus66
Registered User
 
Join Date: Feb 2016
Location: London
Posts: 335
Do you have any clues how to script this? I am a bit lost. Thanks
Octopus66 is offline  
Old 16 June 2021, 20:27   #4
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
I don't know where are the ARexx scripts placed. Maybe in S: directory? You can use this as a template if the script has "use-selected-icons" functionality. I think the new version of http://aminet.net/package/util/wb/EjectADF can be used as a template too. However, the Workbench ARexx port is documented if you want to read/learn.
daxb is offline  
Old 09 July 2021, 23:17   #5
Octopus66
Registered User
 
Join Date: Feb 2016
Location: London
Posts: 335
Thanks for the link - I am struggling with this however.

I am receiving command returned 10.

My script is:
GETATTR WINDOW.ICONS.ALL.COUNT
SAY Result

Not following the error..??

Thanks
Octopus66 is offline  
Old 10 July 2021, 13:00   #6
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Sorry, that is not a valid Arexx script which starts always with a comment:
Code:
/**/
Then if you want to talk to the Workbench ARexx Port then you need to address it:
Code:
ADDRESS WORKBENCH
( https://wiki.amigaos.net/wiki/AmigaO...ctions#ADDRESS )

If you want/need to use the special variable RESULT then you need to "activate" it with:
Code:
OPTIONS RESULTS
( https://wiki.amigaos.net/wiki/AmigaO...ctions#OPTIONS )

Also check http://aminet.net/package/util/wb/THE2 and https://wiki.amigaos.net/wiki/AmigaOS_Manual:_ARexx and http://aminet.net/search?name=arexxguide2
daxb is offline  
Old 11 July 2021, 10:27   #7
Octopus66
Registered User
 
Join Date: Feb 2016
Location: London
Posts: 335
Thanks for the pointers - great thread here too https://eab.abime.net/showthread.php?t=81558

Hopefully won't take me long to work this out now
Octopus66 is offline  
Old 11 July 2021, 14:19   #8
Octopus66
Registered User
 
Join Date: Feb 2016
Location: London
Posts: 335
I managed to replicate the behavior from ClassicWB where you can open a shell at a selected directory by clicking the folder "Dir->Shell" which I always found super useful.

AmigaDOS Script - S:OpenShell
Quote:
.key DIR
cd "<DIR>"
Newshell WINDOW=CON:0/200//100/AmigaShell/CLOSE/
ARexx Script REXX: DirShell.rexx (copied and modified from thread linked above posted by Korodny)
Quote:
/* $VER: DirShell */
ADDRESS WORKBENCH
OPTIONS RESULTS

GETATTR WINDOWS.ACTIVE

ActiveWin = result

GETATTR WINDOW.ICONS.SELECTED name ActiveWin stem ActiveWinIcons

SourceFile = ActiveWin
if right(SourceFile,1) ~= ":" then SourceFile = SourceFile || "/"
SourceFile = SourceFile || ActiveWinIcons.0.name

address command 'Execute S:Openshell "'SourceFile'"'
Octopus66 is offline  
Old 18 August 2021, 23:43   #9
Octopus66
Registered User
 
Join Date: Feb 2016
Location: London
Posts: 335
I have updated this script as the one above did not work with volumes or "root" directories.
Now also works for selected directory icons and directory windows without icons selected.
Should now only error when a file is selected rather than empty selection, or a directory.

Quote:
/* $VER: DirShell v1.2 */
ADDRESS WORKBENCH
OPTIONS RESULTS

GETATTR WINDOWS.ACTIVE

ActiveWin = result

GETATTR WINDOW.ICONS.SELECTED name ActiveWin stem ActiveWinIcons

SourceFile = ActiveWin
if right(SourceFile,1) ~= ":" then SourceFile = SourceFile || "/"
SourceFile = SourceFile || ActiveWinIcons.0.name
if right(SourceFile,21) = "ACTIVEWINICONS.0.NAME" then SourceFile = DELSTR( SourceFile, LENGTH(SourceFile)-20, 21)
if left(SourceFile,4) = "root" then SourceFile = ActiveWinIcons.0.name || ":"
if SourceFile = "ACTIVEWINICONS.0.NAME:" then SourceFile = "Sys:"

address command 'Execute S:Openshell "'SourceFile'"'

Last edited by Octopus66; 19 August 2021 at 00:31.
Octopus66 is offline  
Old 12 May 2023, 11:20   #10
fgh
Registered User
 
Join Date: Dec 2010
Location: Norway
Posts: 817
Quote:
Originally Posted by Octopus66 View Post
I have updated this script as the one above did not work with volumes or "root" directories.
Now also works for selected directory icons and directory windows without icons selected.
Should now only error when a file is selected rather than empty selection, or a directory.
Hey Octopus,

I found this script and use it with my 3.2.2.1 install. Awesome!

Not sure if you noticed, but it throws an error for empty drawers or drawers with spaces in their name if you enter the drawer first.

There is no error if you're in the parent drawer with the wanted drawer selected.

Anyway - it's very nice, thanks!
fgh is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Turn ToolsDaemon on/off Nightshft project.ClassicWB 2 27 April 2020 21:23
Toolsdaemon Jimbo support.Apps 14 27 August 2010 09:46
Toolsdaemon question fc.studio support.Apps 4 11 December 2009 17:04
ToolsDaemon Help Smiley support.Apps 3 11 September 2007 10:17
ToolsDaemon Enverex support.Apps 7 27 April 2004 09:38

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:03.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07729 seconds with 15 queries