We are trying to use KM9 to automate an automated build system.
We use Perl as the main function to create an Ionic project. This works well, it initiates the Ionic project, pulls al the Cordova plugins in, creates the right files. However what it doesn't (and can't do), is setup Xcode correctly.
We need to use Xcode to add a Notification Service Extension for our Ionic client. There does not appear to be any way to use Xcode and any command line options to do this.
We have tried using AppleScript and Xcode is not a good citizen (and AppleScript is poor).
So we fired up KM9 and we can do just about everything quite easily. We can create the Service Notification Extension in Xcode with about 10 mins of work which is wonderful.
That's great, however we need to
Execute the KM9 macro from Perl (or Shell or anything else we can use)
Pass variables into the KM9 Macro as this is an automated job and it will be used for other projects. Hard coding two variables in is a no-no
So, we asking for the advice of the forum. We know Perl and we know Bash very well, we are not experts in AppleScript or KM9. Searching the forum shows lots of code to execute shell scripts from KM but not so much the other way around.
Is there any easy way to do what we are after please? We need to execute a KM9 macro from the command line (or from Perl or Bash) and pass two parameters in.
Thanks for this. I have managed to get it all working now. It appears that osascript only allows one parameter to be easily passed otherwise you need a loop. It was no big deal to pass a single comma delimited argument which I then pass into KM, split it into the components and into variables and use that. After using Perl since 1990 (ish), regexp's hold no fear
I have to say I'm impressed with KM and how it hangs together. I used to write languages (compiled and interpreted) many years ago for fun and profit, and it's been a long time since I have seen a visual language like KM work so well. It wasn't much slower dragging and dropping than writing it in Perl. I wasn't clear on a few things and need to look them up on the website, but it went well.
I like the group feature as I can record, group, deactivate and debug and repeat adding new things. It would be nice to have the degroup feature rather than having to drag the actions out of the group, but I can live with that.
My biggest problem was the way that Xcode interacts with the user, you have to double click a number of frameworks to add them and the only way to do that is to use the finder window and hope everything is in the right place. This is not a problem with KM, just that Xcode is designed to be used by a mouse and user and not to be automated.