Jump to content

Recommended Posts

Posted (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 by dushkin
  • Moderators
Posted

dushkin,

 

  Quote

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:

  Reveal hidden contents

 

Posted

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!

  • Moderators
Posted

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:

  Reveal hidden contents

 

Posted

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

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

:x

Edited by dushkin

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
  • Recently Browsing   0 members

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