Do you have any guess what is different about my installation that could cause mine to not work where others do? Anything different I could try?
Might multiple open databases be an issue? The size of the database? What else?
Do you have any guess what is different about my installation that could cause mine to not work where others do? Anything different I could try?
Might multiple open databases be an issue? The size of the database? What else?
Itâs working fine over here too:
(() => {
const app = Application("DEVONthink 3");
const names = app.selectedRecords.name();
var result="";
console.log(names);
names.forEach(n => result += n + "\n");
return result;
})();
Output:
app = Application("DEVONthink 3")
app.selectedRecords.name()
--> ["Markdown Test"]
/* Markdown Test */
Ergebnis:
"Markdown Test\n"
Actually, I was getting mostly undefined
returns, however⌠running your code sample in Big SurâŚ
andâŚ
Maybe because the second script does not return a value at all?
Iâm saying the selectedRecords.name()
is working, as you have shown (and I confirmed).
However, if youâre just processing selectedRecords()
without the property, itâs returning undefined
results.
So that leads me to think that from Appleâs perspective it âworks.â Arguably from DT3âs perspective too.
What can be different about my setup that is causing a different response that I can try to change? And why the problem with Javascript when the Applescript version works?
Have you rebooted?
Wouldnât that be funny if that fixed if after all this?
It is on my plan to do this weekend - I rarely reboot on weekdays since the computer operates as a server for others. We shall see if that has any impact when I do it.
A screenshot of DEVONthinkâs window showing the selection might be useful.
I honestly wouldnât be surprised but it remains to be seen.
Please ZIP and post the JavaScript version youâre showing here. Something looks weird to me.
We have not deprecated or ended support for JXA.
We both know that those are deliberately evasive weasel-words.
DEVONTtechnologies has, in fact, unlike other companies, egregiously failed to ensure support and full compliance with JXA use of the osascript interface.
You yourself have often attempted to suggest doubtful but explicit rationalisations for this approach.
In the case of smart action code, DEVONTechnologies has not even pretended to support JavaScript, or to comply with the equal status which Apple itself accords to the two languages which the osascript interface supports.
Exactly as I said, and here I repeat it, the problem does not lie with Apple.
It lies, as you very well know, with DEVONtechnologies.
Of course.
Youâre using name
where it should be name()
. These parenthesis are not only meant to amuse @Blanc
Hahaha! Thanks @chrillek
And I have too many screencaps floating around from accessing my M1 Air via VNC.
Hereâs an updateâŚ
Would you verify this on your side? Thanks!
Oops, I didnât verify anything. Just wanted to let you know that the code is fine (a bit awkward but correct and working)
Youâre more the JavaScript wizard than I by a long shot.
That type of JavaScript for loop is definitely new to me.
Any downside you see in that form?
You mean for n in ...
? Well, itâs more what one would use to enumerate the properties of an object. For arrays, Iâd go with
array.forEach(element => {
// Do something with element here
})
Thatâs more in line with the other array functions like map
, filter
and reduce
. Having a for in
loop to get the âpropertiesâ of an array (which are just the indices anyway) and then use something like array[property]
to get at the elements is a bit contrived.