Sorry, guys, I’m here again
I have a question regarding FolderItems: I have a RdioButtonGroup with three choices, how can I have the app let me choose the folder and automatically open my choice of file inside it when I push the OK button?
Let me clarify, say my choices are the following files (created by my app):
a
b
c
I choose b and, via SelectionChanged, I can navigate to the folder where those files are. How can I have b automatically selected when I push the OK button without having me to double click it with the mouse (assuming it is possible)?
Not really.
The issue is not getting data from the RadioGroup, it is transferring the SeelctedItem into the FolderItem so it can open the file by itself without my intervention (except choosing the folder)
What do you mean by “navigate”? Is your item “b” a folder for which you want the user to navigate using a SelectFolder dialog?
For the first part, once the parent folder has been chosen, keep a reference to it using a window’s property: e.g. “ChosenFolder as FolderItem”.
When a radio button is selected, use “Var Item as FolderItem=ChosenFolder.Child(“a”)” to access the folder “a” inside the chosen folder. Add checks for whether ChosenFolder is nil, and various other things.
You want to select the radio button “b” when clicking the “OK” button? Wrong design, IMO. The default radio button should be selected when the window shows, and the OK button shouldn’t alter the selection made by the user; it should rather go on with the selection.
Also, what did you plan to double click on?
Items , b, and c are not folders, they are files inside some folder which I can reach. Selected by a RadioButton, I’d like them to open without having to choose, once inside the specific folder.
I know that all in all it is a wrong design. I have no intention (nor the ability) to commercalize or distribute my codes. I do it for my own fun only, and some use I can put them to.
Mostly is just a test to find how I can accomplish things, even those that make very little sense, programmingwise, and keep them in storage for whatever the future brings. They may never be necessary or useful but if neede, even in some twisted way, I have them in storage.
I know it’s crazy but, as I said, it’s just for fun
Of course, it may be clear for you, but your question is confuse.
NB: You have a FolderItem for a, b and c. Good.
If you want to navigate in the files stored in the a parent folder, do:
Var a_Folder_FI, a_FI As FolderItem
a_FI = SpecialFolder.Documents.Child("Screenshot 2026-02-22 at 09.32.29.png")
a_Folder_FI = a_FI.Parent
YES, the code above is stupid: SpecialFolder.Documents will return the a_FI parent folder, but this is a test code, code to see what I mean.
The idea is: use FolderItem.Parent to get the Parent folder and navigate into that reference with .ChildAt(index) to get the eventual other items in that Folder.
Are you by chance using Monkey Breads plugins because I have some code (approximately 6 lines) that will do just that and it works for Windows and Mac.