BigBot 0 Posted April 22, 2013 Report Share Posted April 22, 2013 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 Quote Link to post Share on other sites
Brutal 164 Posted April 25, 2013 Report Share Posted April 25, 2013 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. Quote Link to post Share on other sites
UBotDev 276 Posted April 28, 2013 Report Share Posted April 28, 2013 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. Quote Link to post Share on other sites
BigBot 0 Posted May 6, 2013 Author Report Share Posted May 6, 2013 UBotDev.com, yes, that is exactly what I was looking for, thank you very much for help. Quote Link to post Share on other sites
UBotDev 276 Posted May 6, 2013 Report Share Posted May 6, 2013 Np. It's not the best way, but I think its the only workaround. 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.