wacek 0 Posted September 3, 2011 Report Share Posted September 3, 2011 Gents, Any idea how to upload images in wordpress using ubot4?I've checked old topics (ubot3.5) but it doesn't work now. Any code samples?Many thanks in advance. Wacek Quote Link to post Share on other sites
Praney Behl 314 Posted September 4, 2011 Report Share Posted September 4, 2011 Can you please post a code snippet on what you have now. I maybe able to help out. Quote Link to post Share on other sites
wacek 0 Posted September 4, 2011 Author Report Share Posted September 4, 2011 Hi Praney, I've tried your solution - http://ubotstudio.com/forum/index.php?/topic/6655-posting-up-images-in-wpit's great for u3.5 however it needs a different shape and form in u4 as you there is no set active windows and no set dialog text commands available. Such a small thing, while very frustrating.I guess there is a workaround and I might be missing something I can click on Choose file button, but then I'm unable to fill the file name and click OK. Quote Link to post Share on other sites
Praney Behl 314 Posted September 4, 2011 Report Share Posted September 4, 2011 Here you go man : click(<id="add_image">, "Left Click", "No") change file field(<name="async-upload">, "#filename") click(<name="html-upload">, "Left Click", "No") wait for browser event("Page Loaded", 30) Hope it helps. Praney Quote Link to post Share on other sites
wacek 0 Posted September 4, 2011 Author Report Share Posted September 4, 2011 Hi Praney, first of all, thanks for your code. Somehow it doesn't work for me. here what I have right now: // set path to image to be uploaded set(#imgupload, "{$special folder("My Documents")}\\WRuskiContent\\imgorg.jpg", "Global") //go to media - add new click(<href="media-new.php">, "Left Click", "No") wait(2) //click Choose file click(<name="async-upload">, "Left Click", "No") wait(1) // insert path to image to be uploaded change file field(<name="async-upload">, #imgupload) wait(1) //click Upload click(<name="html-upload">, "Left Click", "No") wait for browser event("Page Loaded", 30) The code doesn't work for me, I was playing with Wait command, but no results there. Is there something worng with the code?Does it work for you mate? many thanks again Quote Link to post Share on other sites
Praney Behl 314 Posted September 4, 2011 Report Share Posted September 4, 2011 It seems like a tiny mistake in your code, its missing "" on the #imgupload variable. // set path to image to be uploaded set(#imgupload, "{$special folder("My Documents")}\\WRuskiContent\\imgorg.jpg", "Global") //go to media - add new click(<href="media-new.php">, "Left Click", "No") wait(2) //click Choose file click(<name="async-upload">, "Left Click", "No") wait(1) // insert path to image to be uploaded change file field(<name="async-upload">, "#imgupload") wait(1) //click Upload click(<name="html-upload">, "Left Click", "No") wait for browser event("Page Loaded", 30) May wanna try this.. Praney Quote Link to post Share on other sites
wacek 0 Posted September 4, 2011 Author Report Share Posted September 4, 2011 I believe I was testing both,change file field(<name="async-upload">, "#imgupload")andchange file field(<name="async-upload">, #imgupload)no result in either case What it does is, after click(<name="async-upload">, "Left Click", "No")file upload window pops out, but next commands are unable to fill the file name field. so:change file field(<name="async-upload">, "#imgupload")doesn't work in my case Does the code work for you Praney? Quote Link to post Share on other sites
Praney Behl 314 Posted September 4, 2011 Report Share Posted September 4, 2011 Sorry my bad it didn't needed the "" that is for text. Yes it is working for me. had to add a wait as Ubot 4 is too quick. Ok let me do a screencast for you. Quote Link to post Share on other sites
Praney Behl 314 Posted September 4, 2011 Report Share Posted September 4, 2011 Here it is: http://screencast.com/t/2ULO8DuFjM 1 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.