drewness 26 Posted December 19, 2017 Report Share Posted December 19, 2017 Does anyone here use Aymen's XAML UI plugin? I've been trying to get an open file dialog picker to show (the one that comes with Aymen's File Management Plugin) and for some reason whenever I add the command to open the file dialog picker, it never opens the dialog window when I click the button. If I right click and run it in Ubot Studio it opens the dialog window just fine, but it doesn't run when clicking the button in the interface, and it doesn't run in compiled bots either. Does anyone have a workaround for this, or have this same issue? I was thinking about buying Pash's Advanced Dialog Plugin - does anyone use the XAML UI plugin along with it, and can confirm if it does work with it? Quote Link to post Share on other sites
HelloInsomnia 1103 Posted December 20, 2017 Report Share Posted December 20, 2017 You need to use a special command to do this because its trying to do it on the ui thread and it needs to be done from another thread instead (and no not a normal ubot thread). You need this plugin: http://network.ubotstudio.com/forum/index.php/topic/15327-free-local-dictionary-plugin-local-variables-issue-workaround/ here is the code: plugin command("XAMLUI.dll", "Load Xaml UI", "<Grid> <Button x:Name=\"openFileButton\" Width=\"100\" Height=\"30\" Content=\"Open File\"/> </Grid>", "", 400, "Basic") plugin command("XAMLUI.dll", "Xaml event hook", "openFileButton", "Click", "OpenFile") define OpenFile { plugin command("LocalDictionary.dll", "STA thread container") { set(#fileName,$plugin function("File Management.dll", "$open file dialog"),"Global") } wait(0.5) alert("You opened {#fileName}") } 1 Quote Link to post Share on other sites
drewness 26 Posted December 22, 2017 Author Report Share Posted December 22, 2017 You need to use a special command to do this because its trying to do it on the ui thread and it needs to be done from another thread instead (and no not a normal ubot thread). You need this plugin: http://network.ubotstudio.com/forum/index.php/topic/15327-free-local-dictionary-plugin-local-variables-issue-workaround/ here is the code: plugin command("XAMLUI.dll", "Load Xaml UI", "<Grid> <Button x:Name=\"openFileButton\" Width=\"100\" Height=\"30\" Content=\"Open File\"/> </Grid>", "", 400, "Basic") plugin command("XAMLUI.dll", "Xaml event hook", "openFileButton", "Click", "OpenFile") define OpenFile { plugin command("LocalDictionary.dll", "STA thread container") { set(#fileName,$plugin function("File Management.dll", "$open file dialog"),"Global") } wait(0.5) alert("You opened {#fileName}") }Works like a champ, thanks so much! Saving the day yet again lol, much appreciated Sent from my SAMSUNG-SM-N920A using Tapatalk Quote Link to post Share on other sites
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.