If yes, a user would be able to use the same Shortcuts in i(Pad)OS and macOS.
I don’t know if that’s possible. And I also don’t see the point. At the time being, I don’t touch Shortcuts with a ten foot pole, and given Apple’s record with automation technology, I’m not very optimistic that it will get better (in the sense of useful). We still can’t even synchronize Shortcuts across the platforms, and that’s in the third iteration of the product.
Also, why would anyone go through all the loops to run JS code in Shortcuts on macOS if it’s possible to run the code directly in DT (or via osascript or in Script Editor)? Or simply use a keyboard shortcut to create a document or open it.
This whole “run JS in Shortcuts on i*OS” approach is a terrible hack which is only necessary because Apple’s automation support is so broken. Why should one want to run the same hacky stuff on macOS where it’s not necessary at all?
It also has it capabilities hardware, sensors and dialogs.
There is a beta MacOS version but it doesn’t look like like it’s been updated in a while but it works.
yes there is no shortcut support in DEVONthink for MacOS.
Shortcuts has command line support so you could call shortcuts from AppleScript or JXA
shortcuts run <shortcut name> args
You can also call AppleScript or JXA from shortcuts via osascript or via the html trick to run JS in a web page.
You can call AppleScript or JXA script files from AppleScript or JXA script files
You can call shortcuts from shortcuts (shortcuts has a method for this)
You can use functionality from other applications that support AppleScript or Shortcuts
Like above You can use helpers small apps to extend functionality.
So using these options you can get Devonthink to call Shorcuts. Then use logic to call AppleScript/JXA or another shortcut depending on OS/Device. Don’t forget you can breakdown complex shortcuts into sub shortcuts.
AppleScript/JXA hasn’t been updated for ages I am not sure Apple has a future for it. I think shortcut support will become a must eventually.
So it would be trivial to write a Shortcut to create a new document for DT in AppleScript or JXA. But that wouldn’t work on iOS. In order to use the same Shortcut on both platforms, one would have to do some OS divination in the the code.
Correct there is no JXA or AppleScript on iOS/iPadOS.
In order to use the same Shortcut on both platforms, one would have to do some OS divination in the the code.
That’s exactly what I suggested you cannot call shortcuts from DT triggers so you need to create a wrapper. Have shortcuts then call the shortcuts from AppleScript or JXA on macOS for DT if it needs to be an action otherwise as a shortcut from share panel or service, call shortcut from share panel on iOS. Then use URI schema on iOS for DTTG via shortcuts or call ActionScript/JXA or URI for DT on MacOS. Depends on how much functionality can be shared by shortcuts to whether its actually worth it. If not, just write two sets of scripts.
Then use logic to call AppleScript/JXA or another shortcut depending on OS/Device.