Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Can I paste copied text without ctrl-v?


  • Please log in to reply
34 replies to this topic
PhineasGage
  • Members
  • 8 posts
  • Last active: Jan 24 2012 04:12 PM
  • Joined: 20 Jan 2012
I posted a few days ago about this, somewhat. When you use a script to copy text from a text file, is it possible to be able to paste it without actually using the ctrl-v command? Here's the problem; I'm trying to copy text from a text file, one line at a time, then paste it either automatically or with a hotkey into a veency session between my pc and my iphone. I have searched for days to find the proper command for this to work. Everything I've read says that either ctrl-v or command(winkey)-v should paste the text, but it doesn't work. I've searched iOS dev, veency documentation, even looked at how the paste command is done through a bluetooth keyboard and they all say either ctrl-v or command-v.

So, what I'm asking is...is it possible to copy the text and then "retype" (one character at a time) it with the script into the veency session?

Here is exactly what I'm trying to do, step by step:

1 Copy the first/next line from a text file (let's just say they are phone numbers including dashes, as an example) named "numbers.txt"

2 Switch focus to the open veency session with my iphone, where the window's name is always "iphone-8.local"

3 Paste the first/next number one character at a time as if it is manually being typed into the keyboard.

4 Press enter, to submit the number on the form its being entered into

5 Delay the script for a few seconds, because I'm dealing with some lag and network/server latency

6 Enter 15 [backspace] keystrokes (this is to clear the form field in case there is an error with the previous data entered. Normally, this could be done with ctrl-A, then delete. But, those commands don't work when sent through veency, so the backspace keystrokes must be individually sent as if done manually)

7 Repeat the process.

I'd really appreciate any help, and again I'm working to learn the code in autohotkey, but this is also a time sensitive project. So, if anyone wants to write the script for me, I'll donate to your paypal account (assuming your expected donation is reasonable).

  • Guests
  • Last active:
  • Joined: --
Send %clipboard%


PhineasGage
  • Members
  • 8 posts
  • Last active: Jan 24 2012 04:12 PM
  • Joined: 20 Jan 2012
Okay, that works. Now, I'm confused with how to send one line at a time from the text file.

This:
FileRead, Clipboard, codes.txt
winactivate, iphone-8.local
Send %clipboard%
sends the entire contents of the text file.
Should I not be using that and instead use Loop, read? And then some type of line parsing command?

  • Guests
  • Last active:
  • Joined: --
I already answered that <!-- m -->http://www.autohotke...105.html#507105<!-- m --> of course you didn't read it otherwise you wouldn't have asked :D

PhineasGage
  • Members
  • 8 posts
  • Last active: Jan 24 2012 04:12 PM
  • Joined: 20 Jan 2012
I read it, I just don't understand it.
How does that send one line at a time, because of the {raw} command?

  • Guests
  • Last active:
  • Joined: --
What do you think A_LoopReadLine means? There is a help file you know, you could for example, oh, I don't know, open it and type, just guessing here, A_LoopReadLine, and who knows what will turn up? :D

G. Sperotto
  • Members
  • 539 posts
  • Last active: Jun 20 2015 04:54 PM
  • Joined: 12 Dec 2011
Hi phineas.

Ok, i made a code for you. Test it and give feedback.

*** Comments come after ";" in a line so that they do not disrupt the script. Do read these !!


WinMinimizeAll
Sleep, 1000
IfWinNotActive, Iphone ; the word Iphone must actually match the window name of the VNC session (at least the first letters of it) here and in all the lines bellow. So adjust accordingly if it doesn't.
WinActivate, Iphone
WinWaitActive, Iphone
SetKeyDelay, 50, 50 ; Adjust the speed of character sending here. 30, 30 is faster than 50, 50, but is also less reliable since the window may not respond to faster keystrokes. The number is in milliseconds (1/1000 of a second).
Loop, Read, c:\numbers.txt ; This loops through each line of the file number.txt located in the main folder of drive C, executing the below command lines each time it loops through a line. Check the file name and path here and adjust accordingly. Remember: It is currently resolving to a file named numbers.txt located in the main folder of drive C.
      {
       Send {RAW}%A_LoopReadLine% ; This will send the current line contents one character at a time.
       Send `r`n ; This will send the "enter" keypress after each line.
      }


PhineasGage
  • Members
  • 8 posts
  • Last active: Jan 24 2012 04:12 PM
  • Joined: 20 Jan 2012
Thanks, G. Sperotto!

I see that you edited your post. I'll try the new version in a bit and post feedback.

PhineasGage
  • Members
  • 8 posts
  • Last active: Jan 24 2012 04:12 PM
  • Joined: 20 Jan 2012
Works like a charm. Thanks a lot! This will save me hours of boring data entry on an iphone keypad.

  • Guests
  • Last active:
  • Joined: --
And to think you could have had this script days ago if you just replied to your other thread. Sir, I tell you I'm truly shocked. :wink:

lee1255
  • Members
  • 9 posts
  • Last active: Sep 30 2013 04:11 PM
  • Joined: 12 Aug 2012
how can i add backspace to this please help

need backspace after every line it enters has to be from 10-15 spaces each time incase invalid code enter


WinMinimizeAll
Sleep, 1000
IfWinNotActive, Lees-iPhone , VNC ToolBar, WinActivate, Lees-iPhone , VNC ToolBar
WinActivate, Lees-iPhone , VNC ToolBar
WinWaitActive, Lees-iPhone , VNC ToolBar
SetKeyDelay, 50, 50
Loop, Read, c:\numbers.txt
{
Send {RAW}%A_LoopReadLine%
Send `r`n
}

  • Guests
  • Last active:
  • Joined: --
{bs} sends a backspace so insert it where you need it.

lee1255
  • Members
  • 9 posts
  • Last active: Sep 30 2013 04:11 PM
  • Joined: 12 Aug 2012
hanks i added one after the other to make more then 1 backspace

Send,{BACKSPACE}{BACKSPACE}{BACKSPACE}{BACKSPACE}{BACKSPACE}{BACKSPACE}{BACKSPACE}{BACKSPACE}{BACKSPACE}{BACKSPACE}{BACKSPACE}{BACKSPACE}{BACKSPACE}{BACKSPACE}{BACKSPACE}{BACKSPACE}{BACKSPACE}
}


is there a shorter way to do this ? like add backspace x15 something like that

  • Guests
  • Last active:
  • Joined: --
Yes like so Send,{BACKSPACE 15}

G. Sperotto
  • Members
  • 539 posts
  • Last active: Jun 20 2015 04:54 PM
  • Joined: 12 Dec 2011
You can also use the loop command.

loop, 15
Send, {BACKSPACE}

Best wishes :wink:

"What is a suitable automation? Whatever saves your day for the greater matters."
Barcoder - Create QR Codes and other Barcodes using only Autohotkey !!