AutoSet APP_TITLE

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

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

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

AutoSet APP_TITLE

Post by JRL » Wed Mar 30, 2011 3:55 pm

Place the following code at the top of a script that is to be compiled. The APP_TITLE variable will get set to the name of the executable. If someone renames the executable the APP_TILE variable value will automatically get set to the new name.

Code: Select all

Separate>command_line,\,vNamePart
Separate>vNamePart_%vNamePart_count%,.,vTitle
Let>APP_TITLE=vTitle_1

User avatar
CyberCitizen
Automation Wizard
Posts: 720
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Tue May 28, 2013 5:04 am

I like it, although doesn't work 100% if they include the . (periods) in their file name like I do.

Eg: SAH Remote Tools v1.4.IA.exe

Gets cut off at SAH Remote Tools v1.

Code: Select all

ExtractFileName>Command_Line,strFileName
ExtractFileExt>Command_Line,strExt
StringReplace>%strFileName%,",,strFileName
StringReplace>%strExt%,",,strExt
StringReplace>%strFileName%,%strExt%,,strFileName
Trim>%strFileName%,strFileName
Let>APP_TITLE=%strFileName%
FIREFIGHTER

User avatar
Phil Pendlebury
Automation Wizard
Posts: 448
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Tue May 28, 2013 9:27 am

Haha nice. :-)
Phil Pendlebury - Web - Soundcloud - Facebook - MEAP

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Wed May 29, 2013 9:12 am

JRL,
Thanks for your mention of APP_TITLE . I wasn't aware of the auto app title setting feature previously.
CyberCitizen,
Appreciate your ingenious solution.

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

Post by Dorian (MJT support) » Fri May 31, 2013 11:20 pm

Clever. That seems like definite thinking outside the box.

Can you tell I'm going through scripts looking for script of the month?
Yes, we have a Custom Scripting Service. Message me or go here

hagchr
Macro Veteran
Posts: 277
Joined: Mon Jul 05, 2010 7:53 am
Location: Stockholm, Sweden

Re: AutoSet APP_TITLE

Post by hagchr » Thu Aug 18, 2016 11:25 am

Just discovered this, very useful and makes it much more clear when viewing the System Tray for MS files run as exe - as the name will pop-up on hover. Alternative solution using RegEx>

Code: Select all

RegEx>[^\\]+(?=\.exe),command_line,0,m,nm,0
Let>APP_TITLE=m_1

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