Jump to content

Sending text to face book post text box


Recommended Posts

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 by dushkin
Link to comment
Share on other sites

  • Moderators

dushkin,

 

I read the post text from a text file

That sounds a lot like a spam script - would you care to explain why it is not? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

  • Moderators

dushkin,

Fine - thanks for the explanation. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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

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

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

:x

Edited by dushkin
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...