Have you posted this question on the Xojo forum? I thought I was home-free, but then I ran into this bizarre and to me inexplicable "problem". When I realized that Xojo could call AppleScript and that KM scripts could be initiated with AppleScript I was briefly delighted. The Switch statement can seem a little unwieldy and difficult to maintain if it has 30 or more choices, As I say, I could make it work for myself knowing all the innards, but it was difficult tor recommend to others. I have even gone to the effort of restoring the previous Clipboard contents using Set Clipboard to Past Clipboard, but I was not sure that worked all the time. And under some circumstances, I can imagine that there might be some important stuff on the Clipboard that you do not want to be displaced. KM can then looks at what follows the ( 012 in my example) and put that into a Switch/Case and then run the agreed-upon macro or action that 012 specifies. But KM looks to see if the text on the Clipboard starts with and only proceeds if it does. Of course, the Clipboard is changing all the time. Keyboard Maestro detects this because the Clipboard has changed. I put something like on the Clipboard using Xojo. So you can set up an agreed-upon convention that allows Xojo to fire off a Keyboard Maestro script. Xojo has a command to place text on the System Clipboard. This monitors the System Clipboard and when that changes, the script runs. Keyboard Maestro has an oddball trigger, Clipboard Changed Trigger. There is one trick that I have employed that actually has helped me in some of my personal work. Xojo does not support URL schemes from what I can understand so that does not seem to be an alternative. Was it the same issue that stopped your own exploration of Xojo? I find it odd that Xojo is "happy" to run AppleScripts and I can, as I said, successfully run an AppleScript to open an application but I cannot seem to run an AppleScript from Xojo that initiates a Keyboard Maestro macro. Well, I am glad that someone else was curious about the same possibility. My ultimate goal was to do exactly what you are trying. I investigated using Xojo for about a month, because it is so easy to create some nice, powerful UIs.
0 Comments
Leave a Reply. |