Odd Behaviour of AppleScript Dictionary When KM Token in Use

This is really a post/question for @peternlewis...

Two days ago I was using Script Debugger to examine the Finder AS dictionary when I noticed that every so often an additional KM dictionary would become available and then disappear - over and over again.

I tracked it down to the use of the KM token %SafariTitle% and here is a screen recording of it happening:

2022-01-19_15-43-45 (1)

What you're looking at is this:

On the right hand side is Script Debugger's display of AS dictionaries that are available for inspection.

On the left hand side is a KM macro where I alternately add and remove an action that uses the %SafariTitle% token. You can plainly see that when the action with the token is present, SD's display of AS dictionaries starts "flickering" which is cause by the KM editor AS dictionary being duplicated and then destroyed.

My guess is it is the result of %SafariTitle% polling regularly to get the latest title in the browser, and I also guess that other KM tokens that perform polling of some kind will have a similar effect, but I haven't investigated that.

My question is: should that KM token be having this effect on the AppleScript dictionaries that are visible to the system and apart from being distracting (annoying even) is there a possibility that AppleScript scripts might not function correctly?

1 Like

If it is a specific question for me, then use the methods described at Stairways Software: Contact Us

Posts on the forum may not necessarily get any response from me.

Yes, Keyboard Maestro shows the results of the evaluation in the editor, including the token result, which requires running an AppleScript to talk to Safari, which may result in some sort of interprocess communication process being launched, which is apparently what Script Debugger is seeing, since it is showing running processes.

3 Likes

@tiffle

I've tried to find the right way to word this without it sounding argumentative, but I give up. So please know that I'm just clarifying/adding my 2 cents:

This is one of those questions that I'm glad was posted on the forum, even if Peter is the only one who can answer it, because we can all benefit from the answer.

3 Likes

Thanks for the replies.

Perhaps I should have said: “Maybe this is a question only Peter can answer” so as to keep it wide open to the forum generally. My bad :smiley:

1 Like

That's exactly what I was thinking. I just couldn't figure out how to say it without sounding critical!

No, I think this is a good discussion. :slight_smile:

2 Likes

Well the answer is just another piece in the KM da Vinci code for me!!

2 Likes

You guys worry way too much about offending me, I'm not that easy to offend. You should see some of the support email I get :wink:

6 Likes