sginn Posted March 15, 2005 Report Share Posted March 15, 2005 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 Quote Link to comment Share on other sites More sharing options...
IceBox Posted March 15, 2005 Report Share Posted March 15, 2005 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). Quote Link to comment Share on other sites More sharing options...
randallc Posted March 16, 2005 Report Share Posted March 16, 2005 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 Quote Link to comment Share on other sites More sharing options...
joe Posted March 16, 2005 Report Share Posted March 16, 2005 Hello! Here is my two cents: 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.