View Single Post
Old 14 February 2016, 16:46   #4
Korodny
Zone Friend
 
Join Date: Sep 2001
Location: Germany
Posts: 812
Quote:
Originally Posted by gulliver View Post
Hi, I have set a workbench menu item with Toolsdaemon
With 3.9, you don't need Toolsdaemon anymore, you can add a menu item to the tools menu using simple ARexx scripts:

Code:
/* This script will add a menu item to the Workbench's "Tools" menu */

ADDRESS workbench
MENU ADD NAME '"<SOME_INTERNAL_REFERRER>"' TITLE '"<TITLE_THAT_APPEARS_IN_MENU>"' CMD "<COMMAND_TO_EXECUTE>"
The text in angled brackets needs replacing with your own values, obviously, and you can add as menu "MENU ADD..." lines to the above script as you want, then create an icon for it and put it in WBStartup.

Quote:
and I want it to open the current workbench selected file with c:ed. I know this can be done with an ARexx script, but I dont know how
The following is completely untested, as I don't have a 3.9 setup to test right now. Maybe some of the people who do and have have some ARexx experience can help debugging this - experience tells me it won't work out of the box

Code:
/* not tested at all */

options results
address "WORKBENCH"

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 'C:ed "'SourceFile'"'
No error checking at all, it simply tries to open the first selected file (and only that) with C:ed.
Korodny is offline  
 
Page generated in 0.04992 seconds with 11 queries