Detatched Dailog Setting a Checkbox

Introduction
Opi
I have a script that does the following

  • Acts on the the files/folders currently selected
  • Invoked with a keystroke
  • Throws up a detatched dialog box (screenshot)
  • The dialog box has 5 controls which I populate then click ok
  • The files then have a suffix added to them and are moved to a new location.
  • The suffix and location are function of the 5 controls.

So far so good.
It is very cludgy code. For example the locations are hardcoded but it works for me.

Objective
Consider control C2
When I select "cli" (as shown" I want control C5 to automatically check itself.
If I change C2 from "cli" to something else then I want C5 to uncheck

Control C2 Handler
The code handling interactions for C2 is shown in the pink box (right hand side)
The debug output shows 3 instances where this code has run (3 pink boxes in the debug section)

Instance 1
This ran when I tab into C2 and C2 is unpopulated.
Dlg_Control_Check_Box_Ask.value = False which corresponds to C5 unchecked
All good.

Instances 2 and 3
This debug ran when I set C2 to "cli"
Dlg_Control_Check_Box_Ask.value = False on entry. Consistent.
I attempt to check the checkbox now with
Dlg_Control_Check_Box_Ask.value = "true"
There is no error but the .value property does not seem to change.(Red box)
I was expecting the assignment to take and control C5 to check itself.
What am I doing wrong?

Attachments
I fear it might just confuse people but I have attached the entire code and a button in case.


2024-12-14 10h05m12 SuffixMove 023_002.txt (139.5 KB)
023_002_Folder_Random_Suffix_Drop.dcf (220.9 KB)

a quick look shows you are setting control.value to "true" instead of true

2 Likes

OMGoodness! IT is working! Productivity here I come yeahhhh!!!
Thanks @galaxyhub !!!