Add ability to pass arbitrary scripts
I want to be able to use mack for some simple Tell's, but also have some logic that requires if application X is running before calling a tell in the same tool.
Either the ability to call mack.If and pass in a Tell if it tests true, or simply to be able to pass and entire script as a string to mack. mack.Run(script string) or something along those lines would be handy
Couldn't you just import "os/exec" too and do something like this to run a more advanced AppleScript ?
info, err := exec.Command("osascript", "getApps.scpt").Output()
You should get any return data from AppleScript in one form or other into "info".
Possibly also embed the AppleScript in the compiled file to make it invisible to the user (and to in effect "pass an entire script as a string"). Haven't tested any of this concretely for Mack or AppleScript-files, but am curious.
I’m just being practical and understand your original issue was regarding further development of Mack.
Btw, this fork is slightly more updated as long as this current repo doesn't respond to pull requests.
Edit: and this repo seems to be thinking much the same as us: https://github.com/drgrib/mac/blob/4f366006daac7355ea4a771f5367f6dde2b8f2ca/mac.go