dushkin Posted August 30, 2014 Share Posted August 30, 2014 (edited) Hi, I am trying to write a post on facebook using autoit. I read the post text from a text file. Why? Because I want the script to be generic for future uses. So I get the text box focus and then I use Send function. The problem is that wherever I go down a line in the text line, the post is being submitted! How can I avoid that? $oWriteSomethingField = _IEGetObjByName($oIE, "xhpc_message") $ret = _IEAction($oWriteSomethingField, "focus") If $ret == 0 Then MsgBox($MB_OK , "_IEAction", @error) Exit EndIf Sleep(1000) Send($sPost, 1) Thanks! Edited August 30, 2014 by dushkin Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 30, 2014 Moderators Share Posted August 30, 2014 dushkin, I read the post text from a text fileThat sounds a lot like a spam script - would you care to explain why it is not? M23 Draygoes and Morronic 2 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
dushkin Posted August 31, 2014 Author Share Posted August 31, 2014 Hi Melba. Yes, the purpose is to post to multiple groups and other fb pages. No, it is not spam,because the post is about 3 kindle books which my wife wrote and that we intend to publish for FREE for a limited time. That is using Amazon KDP SELECT promotion program. The groups to publish to are groups which their aim is to publish such free items or to help authors to publish their books. So, there is no fear of spamming. I am sure that if facebook will think I am spamming, they will handle it. But be sure they won't. Thanks! Draygoes 1 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 31, 2014 Moderators Share Posted August 31, 2014 dushkin,Fine - thanks for the explanation. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
dushkin Posted August 31, 2014 Author Share Posted August 31, 2014 No problem. I was expecting this kind of wondering... Now, I still need help... Anyone?... Link to comment Share on other sites More sharing options...
Jfish Posted August 31, 2014 Share Posted August 31, 2014 Just a guess but if the string you are sending has carriage returns it will probably activate the submit. I would scrub out all carriage returns if possible and try again ... Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
dushkin Posted September 1, 2014 Author Share Posted September 1, 2014 Thanks JFish. Then it is just becomes messy and unformatted... Link to comment Share on other sites More sharing options...
Jfish Posted September 1, 2014 Share Posted September 1, 2014 True but if the CR submits it you may need to find another way to format it. Perhaps you could string replace the @CRLF with @LF. Line feed may not cause the form to submit. Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
dushkin Posted September 1, 2014 Author Share Posted September 1, 2014 Tried it already. No change :-( Link to comment Share on other sites More sharing options...
Jfish Posted September 1, 2014 Share Posted September 1, 2014 (edited) controlsettext - was thinking thick client - oops - can't delete But this would probably be the IE equivalent: _IEFormElementSetValue ( ByRef $o_object, $s_newvalue [, $f_fireEvent = 1] ). Have you tried that? Edited September 1, 2014 by Jfish Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
Jfish Posted September 1, 2014 Share Posted September 1, 2014 I tested it - it works ... try this: #include<ie.au3> $website=_IECreate("http://www.facebook.com") $oWriteSomethingField = _IEGetObjByName($website, "xhpc_message") $text="This is some text to test it is really long" & @crlf & "this is some more text after a carriage return" _IEFormElementSetValue($oWriteSomethingField,$text,0) Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
dushkin Posted September 3, 2014 Author Share Posted September 3, 2014 (edited) JFish, I understood my problem! When the text was inserted to the post text box it simply did not lengthened the box to show all of it. It is so narrow in its height so it showed only the first line. So when I, accidently, put the cursor inside the text box and pushed the arrow button down 2-3 times, I discovered the rest of the text.... I am so sorry for bothering you... Edited September 4, 2014 by dushkin Link to comment Share on other sites More sharing options...
Jfish Posted September 4, 2014 Share Posted September 4, 2014 No worries - glad you got what you needed. Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now