Function To Tell What Icons are Selected in Workbench Windows

Feature requests for future versions of Hollywood can be voiced here
Post Reply
NathanH
Posts: 107
Joined: Sun Jul 05, 2015 1:29 am
Location: Caldwell, Idaho

Function To Tell What Icons are Selected in Workbench Windows

Post by NathanH »

Hi,

I would like to see a function that returns a table of files that are selected in the currently active workbench window. For example, if I have a drawer of text files open on the workbench screen it would tell me which window is active and which files are selected/highlighted so that I could do something like open them in a text editor, copy them, delete them, etc. I imagine that this functionality could be useful on Windows/Linux/etc. as well.

NathanH
PEB
Posts: 569
Joined: Sun Feb 21, 2010 1:28 am

Re: Function To Tell What Icons are Selected in Workbench Windows

Post by PEB »

You can try out this code. It isn't the best solution, and it only works on Amigas using ARexx, but at least it's something.

Code: Select all

@DISPLAY {Hidden=True}

DebugPrint("You have 10 seconds to select some icons.")

Wait(10000, #MILLISECONDS)

DebugPrint("These are the icons you selected:")

ActiveWindow$=SendRexxCommand("WORKBENCH", "options results\nGETATTR WINDOWS.ACTIVE\nreturn result")

IconNum=ToNumber(SendRexxCommand("WORKBENCH", "options results\nGETATTR WINDOW.ICONS.SELECTED.COUNT NAME '\""..ActiveWindow$.."\"'\nreturn result"))

For i=0 To IconNum-1
	res$=SendRexxCommand("WORKBENCH", "options results\nGETATTR WINDOW.ICONS.SELECTED."..i..".NAME NAME '\""..ActiveWindow$.."\"'\nreturn result")
	DebugPrint(ActiveWindow$.."/"..res$)
Next
NathanH
Posts: 107
Joined: Sun Jul 05, 2015 1:29 am
Location: Caldwell, Idaho

Re: Function To Tell What Icons are Selected in Workbench Windows

Post by NathanH »

Thanks PEB,

I love the Workbench port functionality on OS3.9+ and have used it quite a bit using AREXX. Your code is a great solution for using it with Hollywood. I try to do stuff for AROS too, though and it's based upon OS 3.1 so doesn't have the Workbench port. That's why I was hoping that a function could be written so all the Hollywood targets could have this functionality. Thanks for your help!

NathanH
Post Reply