Posts: 10
Threads: 4
Joined: Mar 2012
I have the exported macro file on the server currently.
Whenever I update my macro and export it, is there a way to have it automatically update on the two other computers I have it imported on or do I have to manually import it again?
Posts: 12,087
Threads: 142
Joined: Dec 2002
On client computers import the file as shared file (the 3-rd button in the file viewer).
However on client computers it will be updated not immediately. When QM restarted or main QM file reloaded. To immediately reload main QM file, click menu File -> Recent -> first item.
To automatically reload main QM file when a shared file modified, can be used macro with file trigger, like this:
Function
reload_qm_shared_file
Trigger
$f 0x3F8 "\\server\sharesfolder" "shared.qml"
function event $name [$newname]
;event: 1 added, 2 removed, 4 renamed, 8 modified
;out F"{event} {name}"
MES m.style="YNn"; m.x=-1
sel mes("Shared file modified on server computer. Update it here in QM? It will reload your main QM file.[][]%s" "Quick Macros" m name)
,case 'Y'
,shutdown -5
;Also check 'Allow single instance' in Properties -> Function properties.
Posts: 10
Threads: 4
Joined: Mar 2012
Awesome thanks! My next question is that if they have custom settings to each of the computers like a different file path or slight changes to the macro, will I have to redo them every time something is uploaded to the server?
Posts: 12,087
Threads: 142
Joined: Dec 2002
They should not make changes to shared macros. If they need different data in shared macros, the macros should get data from eg a local file. Or the macro can select different values depending on user (if all users are known), like this:
Macro
Macro1776
str data user
GetUserInfo &user
sel user 1
,case "user1"
,data="data1"
,case "user2"
,data="data2"