KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: How to remember mouse position and return to it?
Topic Summary:
Created On: 01/05/2018 06:04 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 How to remember mouse position and return to it?   - avkatz - 01/05/2018 06:04 PM  
 How to remember mouse position and return to it?   - Lunis Orcutt - 01/05/2018 06:34 PM  
 How to remember mouse position and return to it?   - avkatz - 01/05/2018 06:53 PM  
 How to remember mouse position and return to it?   - avkatz - 01/05/2018 06:57 PM  
 How to remember mouse position and return to it?   - Grindcore - 01/05/2018 10:26 PM  
 How to remember mouse position and return to it?   - avkatz - 01/06/2018 10:02 AM  
 How to remember mouse position and return to it?   - Mark Bennett - 06/01/2018 04:51 PM  
 How to remember mouse position and return to it?   - Mphillipson - 06/03/2018 03:46 PM  
 How to remember mouse position and return to it?   - Ag - 09/07/2019 03:50 PM  
 How to remember mouse position and return to it?   - kkkwj - 12/23/2020 10:49 PM  
Keyword
 06/03/2018 03:46 PM
User is offline View Users Profile Print this message

Author Icon
Mphillipson
Top-Tier Member

Posts: 280
Joined: 09/22/2014

So I guess you need to have a way of storing the mouse coordinates on the fly without resorting to the clipboard, which could potentially get overwritten anyway.

 

What you need is a way to persist the Mouse Coordinates between the two scripts:

 

Save Mouse Position

 

Go to Last Mouse Position

 

I use a database for this purpose:

 

https://www.screencast.com/t/55fbxYZNmy65

 

If that's a little over your head you can alternatively use a text file to temporarily store the value in the first script.  And then use code to open the text file and read its contents in the second script.

 

Here's an example function to load the text:

 

Function FileText (filename$) As String

    Dim handle As Integer

    handle = FreeFile

    Open filename$ For Input As #handle

    FileText = Input$(LOF(handle), handle)

    Close #handle

End Function

 

Example calling code for this function:

 

Dim result as string

result=FileText("C:\MyFolder\MyFile.txt")

 

Example Subroutine to save a string to the text file:

 

Sub SaveText(textToSave as String, filename  as String)

    Dim fileNumber  as Integer

    fileNumber=FreeFile

    Open filename For Output As fileNumber

    Print fileNumber, textToSave

    Close fileNumber

End Sub

 

For example:

 

SaveText LString,"C:\MyFolder\MyFile.txt"

 

Obviously you need to change MyFolder and MyFile to something more meaningful and an existing folder on your computer.



-------------------------

Thanks Mark


 


Dragon Professional Advanced Scripting/KnowBrainer Scripts
Video Examples of Coding by Voice

Statistics
32133 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 3 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 410 guests browsing this forum, which makes a total of 413 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2021 FuseTalk™ Inc. All rights reserved.