Derfel Posted March 30, 2005 Report Share Posted March 30, 2005 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 Quote Link to comment Share on other sites More sharing options...
ells Posted March 30, 2005 Report Share Posted March 30, 2005 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! Quote Link to comment Share on other sites More sharing options...
Derfel Posted March 30, 2005 Author Report Share Posted March 30, 2005 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 ). Thanx! Quote Link to comment Share on other sites More sharing options...
ells Posted March 30, 2005 Report Share Posted March 30, 2005 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!!) Ells Quote Link to comment Share on other sites More sharing options...
Derfel Posted March 30, 2005 Author Report Share Posted March 30, 2005 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... Quote Link to comment Share on other sites More sharing options...
randallc Posted March 30, 2005 Report Share Posted March 30, 2005 1. check whether they have the macro's in their macro-file2. 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 Quote Link to comment Share on other sites More sharing options...
joe Posted March 30, 2005 Report Share Posted March 30, 2005 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. Quote Link to comment Share on other sites More sharing options...
paul Posted March 31, 2005 Report Share Posted March 31, 2005 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. Quote Link to comment Share on other sites More sharing options...
Derfel Posted March 31, 2005 Author Report Share Posted March 31, 2005 Hi guys, Thanx for all the advice and help. I just read your comments, since I don't have a working internet-connection at home I'll give it a try today! Quote Link to comment Share on other sites More sharing options...
Derfel Posted March 31, 2005 Author Report Share Posted March 31, 2005 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 Thanx for your help! Quote Link to comment Share on other sites More sharing options...
randallc Posted March 31, 2005 Report Share Posted March 31, 2005 Hi! post it too for interest? Good news! Randall Quote Link to comment Share on other sites More sharing options...
Derfel Posted March 31, 2005 Author Report Share Posted March 31, 2005 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. Quote Link to comment Share on other sites More sharing options...
joe Posted March 31, 2005 Report Share Posted March 31, 2005 You should be able to use the "File Attachments" field for any type of file. This is just below the text box where you merrily type your posts. Quote Link to comment Share on other sites More sharing options...
kevin Posted March 31, 2005 Report Share Posted March 31, 2005 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. Quote Link to comment Share on other sites More sharing options...
Derfel Posted April 1, 2005 Author Report Share Posted April 1, 2005 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? Thanks! Quote Link to comment Share on other sites More sharing options...
Derfel Posted April 1, 2005 Author Report Share Posted April 1, 2005 You should be able to use the "File Attachments" field for any type of file. This is just below the text box where you merrily type your posts. Yep, that's what I tried...guess our company-network is really secure Quote Link to comment Share on other sites More sharing options...
Derfel Posted August 26, 2005 Author Report Share Posted August 26, 2005 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.... I can make them Read-Only, of course... Quote Link to comment Share on other sites More sharing options...
kevin Posted August 26, 2005 Report Share Posted August 26, 2005 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. 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.