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
Function To Tell What Icons are Selected in Workbench Windows
Re: Function To Tell What Icons are Selected in Workbench Windows
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
Re: Function To Tell What Icons are Selected in Workbench Windows
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
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