Jump to content
Macro Express Forums

How To Set A Var To Name Of Current Macro Wo Ext


sginn
 Share

Recommended Posts

I know how to set a var to "Name of Current Macro". this works great when you are running the macro from within Macro Express. However, if you create a playable macro, it assigns the entire name of the macro including the extension *.mxe. I am using this variable in the creation of a file name, so it would be nice to just assign the macro name without the ".mxe" part.

 

Thanks

Link to comment
Share on other sites

You can use the Set Integer | Get Position of Text in a Text Variable command to determine the location of the dot(.) in your string.

 

Then you can delete the file extension using the "Delete Part of Text" command starting with character %N1% (The location of the dot that we set in the previous step) and continuing for 4 total characters (The dot, plus the 3 characters in the extension).

Link to comment
Share on other sites

Hi again!

 

Alternatively,

Again, you can retrieve the filename without extension as one of the options in

" Variable set from file" (in file commands) %T2% fromFile as part of filename

 

OR!

 

Get the length of your MacroName in a variable, and "variable string modify" "copy part of text", length 4 less than length of name!

 

Best, Randall

Link to comment
Share on other sites

Hello!

 

Here is my two cents: B)

 

Let's say for example that, after using the Name of Current Macro option, T1 is set to "MyPlayable.mxe". You can remove ".mxe" from the string using a single call to the Replace Substring command:

Replace ".mex" with "" in %T1%

<TMVAR2:21:01:00:001:000:.mex>

Make sure the Ignore Case checkbox is checked.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...