robert-hk Posted June 4, 2005 Report Share Posted June 4, 2005 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. Thanks Quote Link to comment Share on other sites More sharing options...
randallc Posted June 5, 2005 Report Share Posted June 5, 2005 Hi, 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 Quote Link to comment Share on other sites More sharing options...
joe Posted June 5, 2005 Report Share Posted June 5, 2005 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. Quote Link to comment Share on other sites More sharing options...
robert-hk Posted June 5, 2005 Author Report Share Posted June 5, 2005 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. Thanks Robert 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.