Alessio Posted June 5, 2020 Share Posted June 5, 2020 Hi, I Created a custom dialog to create several worksheets. On the custom dialog i made a checkbox to export the active worksheet to a .txt file. I wonder if its possible to make is like: if you check several checkboxes and the "EXPORT TO TXT" checkbox is checked than it wil give me after the sheet is generated the "Export Worksheet" dialog. Example : Check the "Total LED" checkbox Check the "LED Screen 1" checkbox Check the "EXPORT TO TXT" checkbox Press "Create" The Script Creates the worksheet The Script opens the export setings DoMenuTextByName('Export Worksheet',0); You store the Export to a destination The Script will repeat the steps on every checkbox that will be cheked. Part of the scrip: GetBooleanItem(id, 6, Bool); if Bool THEN DoMenuTextByName('Oaktree ALL LED',0); GetBooleanItem(id, 7, Bool); if Bool THEN DoMenuTextByName('Oaktree LED Screen 1',0); GetBooleanItem(id, 8, Bool); if Bool THEN DoMenuTextByName('Oaktree LED Screen 2',0); The id of the "EXPORT TO TXT" checkbox is 37. i hope someone has a solusion. Alessio Quote Link to comment
JBenghiat Posted June 5, 2020 Share Posted June 5, 2020 You’re ultimately going to have to dive deeper into scripting rather than relying on DoMenuTextByName. I suggest having the script retrieve your data and then directly writing the text file. VS has commands for reading data from the worksheet, though you may find that reading data directly from the screen objects and writing to your text file is more efficient. (GetRField() will read data from plug-ins) I would also recommend moving over to python — the built-in routines for working with data and writing to text files is more robust and documented. Quote Link to comment
Alessio Posted June 9, 2020 Author Share Posted June 9, 2020 Thanks for the reply, I created a workaround Now it works like i wanted it to work. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.