Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > Scripting & Automation
  New Posts New Posts RSS Feed - Copy then Paste
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedCopy then Paste

 Post Reply Post Reply
Author
Message
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Topic: Copy then Paste
    Posted: December 19 2017 at 3:43pm
A user requested a new feature: a menu command or keyboard shortcut to perform a copy and paste as a single operation. This is a little obscure to add include in AccuTerm, but you can use VBA scripting to accomplish this. Here is a sample script that checks if there is a selection on the screen, and if there is, the selection is copied to the clipboard, then the clipboard is pasted back to the active session.
Sub Main()
Dim x1 As Integer, y1 As Integer, x2 As Integer, y2 As Integer
If ActiveSession.GetSelection(x1, y1, x2, y2) Then
    ActiveSession.Copy x1, y1, x2, y2
    Sleep 100
    ActiveSession.Paste
End If
End Sub

You can either create a macro using this script - record a dummy macro, then edit the macro and replace the macro code with the above script code. A macro can have a keyboard shortcut attached. Or you can create a menu item (main menu, toolbar, popup menu) that invokes this script. Program the Action field something like:
[Chain "copy_selection_then_paste.atsc"]
Save the script file in the main atwin71 directory if you use the menu approach.

Thanks,

Pete

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.