Jump to content
Macro Express Forums

Path Literals And Constants


Recommended Posts

I've been trying to develop some macros for use in two different environments where the drive letters and folder structure varies. It seems that many of the commands I need require locations to be hardcoded into the command such as for "Repeat with Folder" or launch program.


Ideally I would set the top level path in a string variable, create other string variables by relative addressing and then only use those string variables in the remainder of the programme.


1. Is there a list of commands that require hard-coded or literal constants?


2. What is the best way to circumvent this problem.



Link to comment
Share on other sites


I don't know the answer to Q1. maybe others....


The workaround I use is to set the base path at the beginning of each macro depending on machine name (for which there is a variable set from.. command). This makes it "portable", which I presume is your requirement; then parse as you need as per previous topic;

path parsing

Best, Randall

Link to comment
Share on other sites

Welcome to the group robert-hk!


The Repeat with Folder command uses either string variables or literals. If, for example, one environment was C:\Enviroment1\FolderX and another was Z:\Environment2\FolderY, you could set:


%T1% = "C:\Enviroment1"

%T2% = "FolderX"


when you need the first environment and set:


%T1% = "Z:\Enviroment2"

%T2% = "FolderY"


when you need the second environment. The Folder field would then contain %T1%\%T2% for either environment.

Link to comment
Share on other sites

Many thanks. I had just assumed when I saw "browse", that string variable substitution was not available in that command. My mistake...


I'll change all the macros to incorporate the approach you suggest. Probably a case should have studied the manual first.





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.

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.

  • Create New...