Jump to content
Macro Express Forums

Making The Same Macro Different


Cory

Recommended Posts

I have a company who will have 20 instances of ME running. More or less I need one macro file for all of them but I want certain things to act different. I can think of several ways to do this but I’m not sure what all the pitfalls will be yet so I was wondering if you old sages could give me some ‘best practices’.

 

Here’s a specific example. On one machine I want to schedule a macro that checks a folder ever minute or so for a change. If that change happens it will launch another macro to do something. But I want to be able to change what machine that is during the day whenever that one person is gone or whatever. Kind of passing the torch. I could put a text file indicating who is currently the active one But I don’t want everyone’s macro running every minute checking to see if they are it either.

 

So I was wondering what’s the best way to have the same macros running on different machines differently?

Link to comment
Share on other sites

Have you looked into the Variable Set from Misc command? You could use Set Variable %T1% to "Name of Machine" to determine which machine is running. Or, you could use Set Variable %T1% to "Registered Owner" to determine which user is logged in. Your macros could adjust themselves based on the machine or user.

Link to comment
Share on other sites

Now that I think about it a little more I don't thing the Set Variable %T1% to "Registered Owner" command will change based on the logged on user. This will contain the name of the Registered Owner regardless of which user is logged on.

 

With Windows XP you can do Variable Set String %T1% "%USERNAME%" to get the name of the user that is logged on. This doesn't work for Windows 98, however.

Link to comment
Share on other sites

Here is another idea. Create the macro file that contains the scheduled macro that runs every minute or so. Create a macro that runs when Macro Express starts up. Inside that macro check to see which computer is running and enable or disable the 1 minute macro as needed.

Link to comment
Share on other sites

This is similar to what I have now except I use the current user. The problem in this case is that I want it to change dynamically during the day and I need to be able to pass the torch so to speak.

 

Here’s exactly what I need. I want to monitor a folder for a new PDF file to appear on the server. When it does I want to run the macro for the monitor (a person) which will pull it up and present it to them and ask who to notify. But I also need to be able to change the user to another like when the person goes on break.

 

Difficulty: I don’t want to have 20 machines running macros every minute and, in this case, reading a file from a server.

 

How I am currently doing it: I have a text file on the server that contains the domain user name for the current monitor. I have a little utility that allows the user to select a different domain user which overwrites the file with that value. The macro is scheduled to run every minute, reads from the file the current monitor and if their user name differs aborts the macro. The one thing I added was to add a test before the read from the network file to see if the user is one of four that are pre-designated by the company as fax monitors. So I only have 4 machines hitting the server every minute.

 

My disappointment: It just seems like a kluge. I would love to have a scheduled macro that runs at startup that determines if you’re one of the 4 and then doesn’t run the macro and unnecessary 480 times a day per user. Any ideas on how to do it better? I’m sure there’s some different way to set this up without necessitating separate files.

Link to comment
Share on other sites

I do something similar to your startup file suggestion on my laptop. ME annoys the hell out of me here because I work in different offices all the time and ME gets so temperamental when its macro isn’t available. Takes forever, wants to load backup copies and all sorts of other jive. So now I load different macro files based on if they exist or not. Saves a lot of trouble.

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...
×
×
  • Create New...