It basically says that there is no selection. Which is really weird. Maybe @cgrunenberg has an idea?
I’m seeing the same issue here, so you’re not going nuts… well…
With a small variation…
The only thing I see we changed in regard to processing a selection, was the addition of the
selected records property for faster attribute retrieval.
So why does this work in some situations but not others???
console.log(n.name()) (with the parenthesis instead).
The weird thing here is that for @rkaplan it doesn’t work with
selectedRecords nor with
selection(). Whereas for me (and apparently for you) both are ok.
Here is it in AppleScript…
And this is using the faster retrieval of
The undefined is normal since there’s no return value. You must check the output.
Regardless, I suppose that you’ll still see 0 for the length there. DT has to clear that up.
Correct, just I you, @chrillek, and I have shown.
@BLUEFROG - Any solution anticipated?
How can it be that the same script works for some installations but not others? That seems odd.
So we conclude Apple has basically deprecated or ended support for JXA even though not officially announced?
Given that JS should automatically work just like AppleScript, it would be nice if it actually worked reliably. And if a perfectly simple JS works on in some situations but not in others, it would be nice if this fact would receive a bit more attention.
I’m aware that historically AS is dear and near to the heart of many people here. But frankly: It is a dying language. Apple does not do work on it anymore, and outside of the AppleVerse nobody is using it. It is not up to par with any current technology like HT/XML or even old stuff like regular expressions. Even it’s normal text processing capabilities are light years behind, not to mention array methods, introspection, functions as first level citizens. It goes on and on.
And I’m not advocating to drop AppleScript at all. Just to acknowledge that there is another scripting language available that can do the same things as AS and then some more. It should receive the same support in DT as AS. Just as in Hazel, for example.
Since it now “works” on one Mac DT3 installation but not on others, that suggests to me there might be some workaround possible if we at least knew why that behavior is inconsistent. Maybe it is an Apple issue; maybe it is a DevonTech issue. Do we really know for sure?
We have not deprecated or ended support for JXA.