I want to paste text content but sometimes no text pasted

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mashirojp
Posts: 1
Joined: 17 Feb 2020, 05:42

I want to paste text content but sometimes no text pasted

17 Feb 2020, 06:09

I wanted to send some long text content automatically by autohotkey. Following code is a part of whole code I implemented for that.

Code: Select all


sendText(text){

  clip := clipboardall
  sleep 1000 
  Clipboard = %text%
  sleep 1000 
  ClipWait, 1
  sleep 1000
  send, ^v
  ; sleep 100
  sleep 1000
  clipboard := clip
  sleep 1000 
  clip =

}

; there's more same code as following one in my ahk script file 

send, ^l
sendText( "https twitter.com /compose/tweet"  Broken Link for safety )
send, {enter}
; sleep, 2000
sleep, 8000
text =
sleep, 2000
FileRead, text, C:/pg/autohotkey/somefiles/text_22.txt
sleep, 2000
sendText( text ) ; some issue here 
sleep, 2000
send, ^{enter}
sleep, 3230000

Basically, there's a long text content stored in C:/pg/autohotkey/somefiles/text_22.txt file. `Fileread` to store the content to variable `text`, then try to paste the text in variable with `sendText` function.

This script works well for times, however sometimes I found there was no text content pasted on the desired textarea.
I thought why and I came up with that the reason why is the computer's low spec, so I modified some code to add some `sleep`. But even after that there still was this issue. so I thought the reason why is version of autohotkey, so I updated autohotkey version to latest. But this also didn't solve this issue. I want your help. Thanks in advance.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: CastleChou, Google [Bot], TAC109 and 99 guests