Jump to content
UBot Underground

Open File Dialog With Xaml Ui Plugin


Recommended Posts

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?

Link to post
Share on other sites

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}")
}
  • Like 1
Link to post
Share on other sites

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

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...