Example scripts and tips (replaces Old Scripts & Tips archive)
Moderators: JRL, Dorian (MJT support), Phil Pendlebury
-
JRL
- Automation Wizard
- Posts: 3529
- Joined: Mon Jan 10, 2005 6:22 pm
- Location: Iowa
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
-
CyberCitizen
- Automation Wizard
- Posts: 724
- 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
-
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.
-
Dorian (MJT support)
- Automation Wizard
- Posts: 1414
- Joined: Sun Nov 03, 2002 3:19 am
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?
-
hagchr
- Automation Wizard
- Posts: 331
- Joined: Mon Jul 05, 2010 7:53 am
- Location: Stockholm, Sweden
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