Msched Dialog box cursor position - default to end?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Dman
Junior Coder
Posts: 26
Joined: Mon Apr 21, 2008 2:46 am
Location: Melbourne, Australia

Msched Dialog box cursor position - default to end?

Post by Dman » Thu Jan 24, 2013 1:51 am

Did some searches but couldnt come up with anything on this.

I have dialog boxes that get prepopulated with some info. For example, I have 2 keyboard shortcuts to dialog boxes that ask for a PC name

The resulting scripts either remote control them, or map to them with \\xxx%variable%

The xxx is not the same 100% of the time, so i want to leave it there. Is there a way I can make the cursor in the dialog box have the cursor at the end, rather than having to manually press end?

By default, the pre-populated text is selected.

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

Post by JRL » Fri Jan 25, 2013 10:27 pm

You could use a non-modal Dialog then set focus to the edit field and press end via the script immediately after the dialog opens.

Code: Select all

Dialog>Dialog1
object Dialog1: TForm
  Caption = 'Test'
  ClientHeight = 100
  ClientWidth = 400
  Position = poScreenCenter
  object Edit1: TEdit
    Left = 44
    Top = 46
    Width = 317
    Height = 21
    TabOrder = 8
    Text = '\\ServerSeven\'
  end
end
EndDialog>Dialog1

AddDialogHandler>Dialog1,,OnClose,Quit
Show>Dialog1
SetDialogObjectFocus>Dialog1,Edit1
Press End

Label>IdleLoop
  Wait>0.01
Goto>IdleLoop

SRT>Quit
  Exit
END>Quit

Dman
Junior Coder
Posts: 26
Joined: Mon Apr 21, 2008 2:46 am
Location: Melbourne, Australia

Post by Dman » Sat Jan 26, 2013 7:58 am

You nailed it, thanks JRL!! I appreciate you doing the full code.

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