Quantcast
Viewing all articles
Browse latest Browse all 17251

How to get smart rule to act on tags created on documents

You’re not even running a python script “from the AppleScript wrapper” – you’re spawning a shell that runs Python which finally runs a python script. And you pass no parameters to neither the Shell nor Python nor your script. In the end, you have these processes

  • DT
  • shell
  • Python
    all running in their own sandboxes, not being able to access the other’s data (fortunately) but through an API.

How would that script even know about the context you’re calling it from? All it could possibly see around it is Python. It doesn’t know about the Shell nor DT’s smart rule.

theRecords is a list of Object Specifiers passed into your performsmartrule handler. It remains there, it’s not going anywhere else unless you tell it to. And you can certainly not tell it to cross process boundaries. What you could do, is to pass the UUIDs of the records on to your Python code and then access the records by these UUIDs one by one. Which is akin to sending someone a PDF with text layer as a fax, having them scan and OCR it, only to get at the text again. Feasible. Not pretty.

If you want to run a script in your smart rule, use AppleScript or JavaScript. And frankly, using PyDT3 instead of JXA introduces another layer of complexity, without bringing any advantages (last time I looked at it, it was still missing some methods).


Viewing all articles
Browse latest Browse all 17251

Trending Articles