Dynamically rename Chrome window title for extra "safety"

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
User avatar
Grovkillen
Automation Wizard
Posts: 998
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Dynamically rename Chrome window title for extra "safety"

Post by Grovkillen » Sun Apr 18, 2021 7:42 am

If you want to be sure you're focusing on the specific window you can use this little trick. The Wait>1 is added because Windows needs a bit of a head start to update the window title internally.

Code: Select all

  ChromeExecute>SessionID,document.title = "%SessionID%%RND_SEED%";
  ChromeGetInfo>SessionID,title,CURRENT_TITLE
  Wait>1
  SetFocus>CURRENT_TITLE
  ResizeWindow>CURRENT_TITLE,200,200
I'm mostly using the --app= switch and thus not needing to care about the "Google Chrome" text in the window title. You may need to add the SetFocus>%CURRENT_TITLE%* (star).
Last edited by Grovkillen on Mon Sep 27, 2021 5:52 am, edited 2 times in total.
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1347
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Dynamically rename Chrome window title for extra "safety"

Post by Dorian (MJT support) » Mon Apr 19, 2021 7:46 am

I look forward to trying this. Thank you for sharing. :D
Yes, we have a Custom Scripting Service. Message me or go here

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