Jump to content
UBot Underground

File Type Filter using UI Open File


Recommended Posts

Hi, 

 

As i am newbee to UBot as well as to this I am going through learning right now and need help regarding if there is any option to filter File Type while selecting files using 'UI Open File'; could someone help me finding or answer. I suppose to Select Video Files only three types of Format *.MOV, *.FLV and *.MP4. 

 

Thanks for help

 

Link to post
Share on other sites

It seems that you could set the file types you want as variables, and then let the bot check the input to see if it is one of your accepted variables, if yes, then proceed, if no then alert user and stop script.

Link to post
Share on other sites

I'm afraid you'll have problems with achieving that since HTML input parameter "accept" also doesn't work.

 

I had some minutes and I tried to realize that with using "type keys" UBot command, where you trigger UBot Command once the button is clicked, ant the whole thing looks like this (notice I'm displaying jpg only): http://screencast.com/t/8mWlgU5ye

 

However, this is not the most convenient way (it didn't work when I tried to save UBot source file to share it here) but it does the job. :)

 

Bellow is the code:

 

ui html panel("<input type=\"file\" fillwith=\"value\" variable=\"#a\" onclick=\"ubot.runScript(\'type()\')\"> ", "")
define type {
    wait(0.1)
    plugin command("WindowsCommands.dll", "type keys", "Untitled Bot* - UBot Studio Developer Edition", "HwndWrapper[uBot Studio.exe;;37576c7d-4921-4a27-b6ab-84ec2c90bdec]", 746, 814, "*.jpg\{ENTER\}")
}

And code example for none DEV version:

ui open file("<div onclick=\"ubot.runScript(\'type()\')\">", #a)
define type {
    wait(0.1)
    plugin command("WindowsCommands.dll", "type keys", "Untitled Bot* - UBot Studio Developer Edition", "HwndWrapper[uBot Studio.exe;;37576c7d-4921-4a27-b6ab-84ec2c90bdec]", 746, 814, "*.jpg\{ENTER\}")
}

 

If you'll try to use it, run wizard for "type keys" instead of using this code directly, although this code will work in unsaved UBot Studio project.

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...