I have realized that DTP has a great potential if you have scripting knowledge, which I do not have. When people post code here, I never know what to do with it. Should I enter it in a smart rule or in the apple script editor (how?) and how can I start the script then? Is there any good tutorial or forum posting that is helpful as a starting point for using scripting in devonthink? Some time ago I tried to go through the manual, maybe I should do this again, but maybe someone can help with a step-by-step instruction for dummies (how to run your first script in DTP) or refer to any good source in the forum (there are so many postings, but most of them require already some basic scripting knowledge). In my youth I have coded simple programs in Basic language, that’s my only coding experience. Do you think applescript will still br supported in future macos versions - so that’s the right way to learn applescript or should I focus on another language? Thanks a lot for your help in advance.
I’m fairly certain that AppleScript will continue to exist on the Mac.
Whether that can be called „supported“ is another question.
In my opinion (!), it’s an outdated „language“ (in quotes because there’s not even a formal grammar for it, much like with Basic). It’s lacking nearly everything a contemporary language should offer:
- string methods
- regular expressions
- array methods
- introspection
- user-defined classes
- advanced data types like
Set
And it doesn’t exist anywhere but on the Mac. JavaScript, otoh, develops continually, is clearly defined and available everywhere. More benefits from learning that then AS – but that’s just me. OTOH, Apple’s JXA (JavaScript for Automation), the integration of JavaScript with Apple’s scripting technology, is unfinished and unpolished. It mostly works, but there are edge cases, especially with the ObjC bridge, where the results are surprising or code doesn’t work though it should.
And: every task can be solved in every programming language. It just might be easier in one than in the other.
As to „how do I start“: @pete31 has explained that several times, iirc. And there’s a ton of older texts on the Net dealing with that, eg at MacScripter. No need to repeat all that.
I’m a longtime Applescript user, and appreciate it’s integration in Devonthink
The Applescript editor is a useful tool for editing scripts and access to each app script dictionary
I actually use the Script Debugger app; a more advanced tool
The DT toolbar includes an icon for quick access to the scripts folder and launching scripts
Lots of script examples there
thanks so much to all of you