Beginners question - Dot Net framework classes

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
helenmam1
Newbie
Posts: 1
Joined: Tue May 10, 2011 3:09 am

Beginners question - Dot Net framework classes

Post by helenmam1 » Tue May 10, 2011 3:18 am

I am trying to develop a fix so that my cursor position in a list is not lost when I click off and return to the list in SAGE ACT. I am not really knowledgeable about macros etc and first started looking at Autohotkey to achieve this. I posted a message on their forum, but is seems this is not possible with Autohotkey as I am told it needs a programme with greater support for control classes belonging to .Net Framework (whatever that means!) This has now led me to look at commercial software in the hope that I can achieve what I want to achieve. My question is whether it is possible to do what I want to do in Macro Scheduler? If so how would I go about doing this? If this is not possible in Macro Scheduler does anyone have any other suggestions?

For more details (with pictures) about what I am trying to achieve please see the following links:

http://www.autohotkey.com/forum/viewtopic.php?t=71412
http://www.autohotkey.com/forum/viewtopic.php?t=71328

Thanks Helen

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue May 10, 2011 1:32 pm

Here's a possible method. See the remarks

Code: Select all

//Get the handle of the ACT window.  If ACT is not the name of the window
//Change "ACT*" to "WindowName*"
GetWindowHandle>ACT*,whnd

//Get the ACT caret position in a loop
Label>Loop
  Wait>0.01
  //Get the handle of the current window
  Let>WIN_USEHANDLE=1
    GetActiveWindow>Title,winX,WinY
  Let>WIN_USEHANDLE=0
  //If the current window is ACT get the window relative caret position
  If>Title=whnd
    GetCaretPos>CarX,CarY,1
  Else
    //If the current window is not ACT go into a loop and wait for
    //Act to become the current window.
    Label>InnerLoop
      Wait>0.01
      Let>WIN_USEHANDLE=1
        GetActiveWindow>Title,winX,WinY
      Let>WIN_USEHANDLE=0
      //When ACT becomes the current window save the current cursor coordinates
      //move the mouse to the saved caret position and left click, then move
      //the mouse back to the saved cursor coordinates.  Then go back to acquiring
      //the ACT caret position
      If>Title=whnd
        Add>WinX,CarX
        Add>WinY,CarY
        Add>WinY,5
        GetCursorPos>CurX,CurY
        MouseMove>WinX,WinY
        LClick
        MouseMove>CurX,CurY
        Goto>Loop
      EndIf
    Goto>InnerLoop
  EndIf
Goto>Loop
!~2000~!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts