Jump to content
Macro Express Forums

Building A Macro That Updates Macro's


Derfel

Recommended Posts

Hi all,

 

I've built several macro's to ease the work within our group. But since these macro's change regularly (changed links, improvement in the macros, etc.) I need to update them regularly too. At the moment I've password-protected them, but I think I'll need to drop that.

 

My problem is: I need to write a macro, which automatically (on start-up pref.) checks whether the macros are installed and if yes, it should import the newest version from the network-directory.

 

I haven't found out yet how to do this (uploading and importing & deleting macros).

 

Is there anyone around who has done a similar thing with a macro? Or does anyone know where I can find additional info on this subject?

 

Thanx in advance!

 

Derfel

Link to comment
Share on other sites

Hi Derfel - I'm afraid this isn't an solution - just a bump for your question.

 

I'd also like the ability to update a macro (and one that is password protected for editing at that!) using another macro.

 

I tried it a few weeks ago but when you get to the stage of entering the password for the updated macro, my update macro freezes so I assumed there was no way of doing it.

 

Would it be possible to write an "update macro" function for future releases that allows you to hard code the edit and run passwords in? I know this doesn't help for now but I think it would be a very useful addon.

 

Let's hope someone knows of a solution!

Link to comment
Share on other sites

Hi ells,

 

Thanx for your info. According to my information it is not possible to update a password-protected macro using an other macro. Your experience appears to confirm that. Tha's why I expect to be forced to drop the password. Should some silly user decide to try things on his own and change the macro (on his PC), then it's his own fault... ;) The next time he logs in, the macro will be replaced anyway.

 

Have you tried it with non-password-protected macros? And if so: did it work?

(and if yes: please send / post the solution :P ).

 

Thanx!

Link to comment
Share on other sites

Hi Derfel,

 

Am afraid I have not tried it without a password protected macro but it should work with the built in command "Macro" "Load New Macro File".

 

To check to see if there is a newer macro file available at startup, I would make a playable macro file (make the macro in the editor, then right click it in Macro Explorer and click Export - Export as playable macro).

 

To actually perform the check, one method that may work (I do not think Macro Exp actually has the ability to check when a file was created) is to have a text file in your network path with the latest macro version.

 

Inside that text file would be the latest version number of your macros. Similarly, each machine would have a text file containing its current version of macros. Then by putting the two values of the text files into variable and comparing them, if they do not match then run the "Macro" "Load New Macro File" command. (First I would copy over the latest macro file to a set directory on the computer though).

 

Put a shortcut to this macro into startup and then everytime the machine is started it will run this macro and perform the check and update your macros to the latest version.

 

Sorry for the long winded reply - hope it helps you a bit! (if it even works at all!!) B)

 

Ells

Link to comment
Share on other sites

Thanx for the reply!

But I'm afraid that loading a new macro-file wil not do: all the users have their own macro-files, so loading another macro-file will replace their macrofile with the new one. What I need is to import a couple of macros into their macro-set.

 

I've been thinking about the following procedure:

1. check whether they have the macro's in their macro-file

2. if yes: delete the old version

3. import the new version from the group-directory

 

but i' haven't figured out yedt how to import a macro-file using a macro...

 

I'll keep trying though...

Link to comment
Share on other sites

1. check whether they have the macro's in their macro-file

2. if yes: delete the olde version

3. import the new version from the group-directory

 

but i' haven't figured out yedt how to import a macro-file using a macro...

Hi Guys;

 

Lots of thoughts; I hope someone inPGMacros has done this, and can help

WORK-AROUND?????==============

To follow logically; it seems hard to import individual macros.

A work-around would be to keep a separate Macro Library file on the server and keep a list of macros which should be deleted/ re-imported fresh each day; that seems to me to be achievable?

 

3. import the new version from the group-directory

?works if "Select All" (individual ones do not select easily unless the first few letters of the macro name do not clash with any other?)

What do you think?

Randall

Would this work? - Seems to work OK so far as below?

updater.mxe

Link to comment
Share on other sites

Hello Derfel and welcome to the group!

 

The passwords make no difference. You can delete and import password protected macros without being prompted for the passwords if you are doing the deleting and importing from a macro. In other words, if you attempt to delete a macro from the Macro Explorer window manually, you will be prompted for the password. On the other hand, if you use the Macro Delete command you will not be.

 

There are two ways to import macros: from external, playable (.mxe) macros and from another macro (.mex) library. Randall is correct that importing needs to be done from another macro library. The reason, of course, is that the imported macros will retain their passwords. This is not so with playable macro files. After all, a playable macro is just a text file. It contains none of the activation, security protection, icons, scheduling info, or notes attached to it if it were inside a macro library.

 

The task you have at hand does not seem to be at all difficult. I know that Paul created macros that regenerates the PGM Functions Library when we need it to. But that is a little different.

 

In your situation, you need two server-based macro libraries, the one you normally work with for development and the other to hold macros that have changed and need to be deployed across the network. If you are using macro categories then you will want to keep the same internal structure in both libraries, and also the ones on the network.

 

I would also suggest an "update" folder hierarchy on the server. There would be folder names underneath; one for each workstation on the network. Within each of these will be dummy file names of those macros in the deployment library. Why? Well, since you want this done automatically, the macro libraries spread across your network will need to check "something" to determine if any of it's macros need replaced. A run-on-launch macro will process it's own folder within the hierarchy to determine if there are any files and if so, use those names to match those in the deployment library. Once the task is finished the run-on-launch macro will delete the files. This has the additional benefit of targeting specific workstations.

 

The run-on-launch macro should be easy. Remember that you can treat the Macro Explorer window like any other application. In other words, you can use a macro to perform tasks just like any other program.

Link to comment
Share on other sites

When I get home tonight (Oz time) I'll take a look at the maintenance stuff I built for our PGM Library, and give you the details of what's relevant for your needs.

 

Later

OK, now that I've had a chance to look, I'm starting to remember just how complex this stuff was to construct! My export suite allows me to export currently selected macros (I have a function which allows me to select macros in various ways), or all visible macros, or all macros, or a specified number of macros starting from the currently selected macro. Furthermore it allows me to retain the current categories and subcategories of the exported macros for use in the target library.

 

It uses a concept of "core macros" which are sent to a temporary export library, to which control is subsequently passed during the export operation, and switches libraries several times according to dynamically passed parameters (i.e. I can define how many switches and what macro is to start in each of the switched-to libraries).

 

It took a great deal of time and effort to construct, and is not so well documented <g> (it's really for our own internal use). Since the original author seems to have constructed his own solution, it's probably not of great interest here for me to go into more detail.

Link to comment
Share on other sites

Hi guys,

 

just to let you know: I've found it and it appera to be working fine!

I created a simple .txt-file on the server and placed the macros on the server.

 

The macro reads out the macro-names to be replaced out of the txt-file (no need to check who has which version: I just update them everymorning) and then deletes the current version and imports the new macro!

 

As Joe already mentioned: actrually quite simple! I just hadn't thought about it that way :lol:

 

Thanx for your help!

Link to comment
Share on other sites

Hi,

 

I've tried to upload a copy, but I get the error "You cannot upload this type of file". I've tried to upload it as .mex and as playable. I suspect our network is blocking...sorry. I'll try to find a workaround, but I don't have internet at home at the moment, so it might take a couple of days.

Link to comment
Share on other sites

Well this may be a little late. (I've been off for a few days of Spring Break.)

 

The way I would do this is to write the macros that change frequently and then put them into an external macro text file. Then, inside the macros themselves, I would put the Load Macro Text File macro command.

 

Once this is done, then all you have to do is replace the external .txt files that contain the macros. These files can be located anywhere on your network or local drives.

 

To create the external macros use the Load Macro Text File macro command.

 

You may still want to write an 'updater' macro to copy the macro text files.

Link to comment
Share on other sites

The way I would do this is to write the macros that change frequently and then put them into an external macro text file. Then, inside the macros themselves, I would put the Load Macro Text File macro command.

That's a great idea! Why didn't I think of that? :unsure:

 

Thanks!

Link to comment
Share on other sites

  • 4 months later...
The way I would do this is to write the macros that change frequently and then put them into an external macro text file. Then, inside the macros themselves, I would put the Load Macro Text File macro command.

 

Once this is done, then all you have to do is replace the external .txt files that contain the macros. These files can be located anywhere on your network or local drives.

 

Is there any way to keep these txt-macros protected with a password? Or should I just give that up.... :unsure: I can make them Read-Only, of course...

Link to comment
Share on other sites

Is there any way to keep these txt-macros protected with a password?
Sorry, no.

 

You might be able to write some macros to detect when one of the txt macros has been altered but that might not help.

 

If you are using Windows XP you could create a folder that your users can read from but not write to and put the .txt macros in it.

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...