As above. I'd like for an installer app I'm working on to be able to install Macros into a Macro folder for an app Without the user needing to install them manually. Is this possible?
Without the user needing to install them manually.
I wonder if that sounds like a good idea ?
Could easily be translated to:
without the user knowing that they've been installed ...
I hadn’t thought of it that way - but I suppose someone should. I’m thinking about making that a part of an installer app for a suite that also uses KM macros as an option. It’s the kind of thing I’d take with me and install on another system I would use, or that someone else could use also. Of course, the user would be aware of it. And it’s not as if a user installing them is difficult - I’m just looking to streamline.
Since you raise this point - what about this approach? Does this seem too invasive?
The installer installs Macros in a folder in the user's ~/Documents.
I could add an AppleScript to be executed by the installer that would select the macros in the finder and double click, which will install them in a new folder in KM, deactivated; and the installer should prompt with these instructions:
"To complete the Keyboard Maestro Macro installation:
Open the Keyboard Maestro Editor from its menu bar icon.
In the Groups column on the left, click on the folder "For your [appropriate app] Macro Folder".
Select the contents and copy (command-c).
Click on your [appropriate app] macro folder in Groups. Paste (command-v).
Select the new macros, control-click on them and choose "Enable" from the options.
Close the Keyboard Maestro Editor window.
Done!"
I might lose some of my privileges on this website (or at least have my posts removed) if I helped people "streamline" by removing important security features, such as by undoing the built-in disabling of any new macros.
You can do whatever you want. You can even remove security features, but it's fairly unlikely that any of the wizards here will help you with that.
I don’t want to disable anything. That’s the entire point of the double-click install - they are disabled when imported.
Okay, that's better, although it originally sounded like you wanted the security part of the process disabled when you wrote "without the user needing to install them manually." Enabling them is part of the manual process. Hence the confusion on my part.
Upon further review of your prompts, it seems that the macros you want the user to install are not already in their final destination folder. Why is that? That looks like a big mistake. Why can't you place the macros in the correct folder from the beginning? This would save the user from having to read your prompts and move the macros manually. In fact, your instructions are having the user COPY rather than move the macros. This is a second mistake, as copies of a macro with the same trigger will result in minor to very serious problems, depending on the trigger attached to the macro.
What is wrong with the current mechanism? All the user has to do is double click on the file, and the macro shows up on the screen instantly, awaiting the user to press "Enable." There's nothing really to streamline there. It's about as simple as you can get.
Being concerned about security is a valid and important thing to me. But I don’t see anything from my point of view that indicates my intent was or is to bypass security - maybe there’s a subtle difference between what is possible to someone with a greater awareness of these possibilities than mine and what my intent might be. I’m fairly new on this forum - do people come on here asking how to do nefarious things in public?
I absolutely appreciate your awareness of the issues, because now I know something I didn’t, and I wasn’t thinking about any of this at all before now. But what I do know is that double clicking on a macro or group of macros opens them up disabled. And the group is disabled. So that seems secure to me.
The reasons I want to do it this way:
I want to have a single installer that does lot of things. Macros are not the only thing getting installed. But they are an option that has to be specifically chosen, and the user who does so knows they want them installed. Could I just put them in a folder and say “now you install them”? I could. But I want to know what’s possible as far as making this more streamlined. To me that means putting them in KM, and only requiring the user to put them in the desired folder or folders - since these macros would work with a number of related apps and revisions of apps. That’s a slightly unusual scenario, but there it is. The group that these will end up in depends upon the version and flavor of the app, so I can’t anticipate that.
The typical user for what I am doing carries with them a probability that they would make changes to things that get installed. I offer a fallback position in that these would be disabled and in a disabled group that would not interfere with any operations, as far as I can see.
Another possibility is that I redo these macros in AppleScript and don’t involve Keyboard Maestro at all - but the thing is, I would like more people to use this platform, and I want them to have more reasons to do so.
How is adding extra dialog boxes more streamlined? To me, that's less streamlined. It's already as streamlined as it can be: there are no dialog boxes you need to read and comply with.
You can do anything you want, as I said. I asked you a couple of questions about your way, and you didn't answer them.
Now I have a third question for you: how do you want your solution triggered? I don't think it can be triggered by the user double clicking on a macro file. So how do you want it triggered?
Thanks for your help and input.
If i understand your logic here, why not just have the original macro file be the "fallback" and have the macros correctly foldered in their initial install state? If your imagined user modifies the macro and breaks something, there is always the original kmm file in their documents folder, or whever it was downloaded.
Also
Not via python as far as i know, but Applescript can import macro groups and enable them. I do something similar to update / install a macro set for a set of internal tools I use at work.
The apps and versions of apps that these macros address have varying names, so I can't anticipate what they would be, and thus I can't export them as being in the correct folder already. And you are right that the user would have it from the basic install. To be honest I liked the idea that it would already be there in KM, albeit disabled, so they could just copy/paste it. I'd even considered removing it from the documents folder once it was opened by KM just to declutter. If a user needed the unedited original they wouldn't have to go look for it - it would be right there.
Interesting about AppleScript. I do kind of prefer that the user enable them, because that's a reminder that they can turn these on or off, and they have control over what runs on their system. If it were just for me I would do it with AppleScript, but for other users/customers that might seem a little invasive. It's kind of like the uncanny valley - if something does a lot of kind of invisible things with your system, in the first place more can go wrong; and in the second place it can feel uncomfortable.