inbox zero - rules or scripting?

Hi,

I’m trying to grasp DTPO a little more in depth. Often times it feels a bit like the needle and the haystack…

I’ve read that we can ad a script to a group.
Up to now I have only worked with smart groups.
To me it seems that smart groups ar extremely handy, but may also be tricky.
Tricky in the way that they are not really a folder (as opposed to their folder like icon) but only a smart filter showing you items in a ‘smart’ ‘filtered’ way.
But if I move a smart folder, I don’t take the content within it.
In fact I only move the ‘smart filter’ and if the contents hasn’t been moved with it, it will be empty.

So far so good.
Now to my question:

  1. Is there some way to add rules to e.g. the inbox?
    e.g. if item has this tag or this name => move to blabla?

I have cut my fingers already quite a couple of times, and am looking for a way to sort of keep my ‘global inbox’ to zero.

  1. Can you point me to a step by step example of how to ad a script to a group?

Thanks a lot!

Are you familiar with the Search feature in the forum? It’s really pretty good – 8) Click “Advanced Search” up near the top of this page. Here’s an example:

search.php?keywords=triggered+scripts&terms=all&author=&fid%5B%5D=20&sc=1&sf=all&sr=posts&sk=t&sd=d&st=0&ch=300&t=0&submit=Search

Thanks for pointing out - I was not familiar with Advanced Search.
However it did not reply my question.

I distinct between two things:

  • OS level folder action script
  • DTPO Group level script

In this post padillac describes a simple script that he has attached to a DT group.

But how do you attach a script to a DT group?

Should this be done by selecting the group - click info - there attach the script?
Is this the one and only way to attach a script to a group?

Here’s what I did:

  1. copy padillac’s funky.scpt
  2. save it as scpt
  3. selected my DTPO group
  4. info => script => select => funky.scpt
  5. then filed an eml to this specific group

Nothing happened. (I’ll go read further down the cadillac thread to see what was the outcome…)
Console throws these

13/04/16 00:25:35,401 DEVONthink Pro[341]: Processed 1 mail messages from “Apple Mail”; imported: 1, failures: 0, duplicates: 0
13/04/16 00:25:58,496 WindowServer[161]: CGXGetConnectionProperty: Invalid connection 71683
13/04/16 00:25:58,621 Console[346]: Failed to connect (_consoleX) outlet from (NSApplication) to (ConsoleX): missing setter or instance variable
13/04/16 00:26:18,086 CoreServicesUIAgent[12579]: unexpected message <OS_xpc_error: <error: 0x7fff7302dc60> { count = 1, contents =
	"XPCErrorDescription" => <string: 0x7fff7302df70> { length = 18, contents = "Connection invalid" }
}>

After restarting DTPO I got the “funky” message from the script - without doing anything
But when I try to file another eml into the group - nothing happens…

I’m not sure if all the messages below are relevant to this script.
I have DTPO preferences set to select destination group.
At the moment of selection, I see a script symbol appearing…

13/04/16 00:36:42,908 storeaccountd[397]: AccountServiceDelegate: Accepting new connection <NSXPCConnection: 0x7fd1a89b3590> connection from pid 11011 with interface <AccountServiceInterface: 0x7fd1a8993c70> (PID 11011)
13/04/16 00:36:42,918 storeaccountd[397]: AccountServiceDelegate: Accepting new connection <NSXPCConnection: 0x7fd1a8335cc0> connection from pid 723 with interface <AccountServiceInterface: 0x7fd1a833e410> (PID 723)
13/04/16 00:36:42,932 storeaccountd[397]: AccountServiceDelegate: Accepting new connection <NSXPCConnection: 0x7fd1a898b7a0> connection from pid 723 with interface <AccountServiceInterface: 0x7fd1a89b1b10> (PID 723)
13/04/16 00:36:44,105 storeaccountd[397]: ADI: {
    Connection = "keep-alive";
    "Content-Length" = 32;
    "Content-Type" = "application/x-dmap-tagged";
    Date = "Tue, 12 Apr 2016 22:36:44 GMT";
    "Strict-Transport-Security" = "max-age=31536000";
    "apple-originating-system" = UnknownOriginatingSystem;
    "apple-seq" = 0;
    "apple-timing-app" = "5 ms";
    "apple-tk" = false;
    "server-cloud-daap-version" = "1.0";
    "x-apple-application-instance" = 513202;
    "x-apple-application-site" = NWK;
    "x-apple-jingle-correlation-key" = PCBMIZ45FAH24GS2REEFK3KEMM;
    "x-apple-request-uuid" = "7882c467-9d28-0fae-1a5a-8908556d4463";
    "x-webobjects-loadaverage" = 0;
}
13/04/16 00:36:44,106 storeaccountd[397]: AccountServiceDelegate: Accepting new connection <NSXPCConnection: 0x7fd1a84f3770> connection from pid 11011 with interface <AccountServiceInterface: 0x7fd1a84f3ac0> (PID 11011)
13/04/16 00:36:44,109 storeaccountd[397]: AccountServiceDelegate: Accepting new connection <NSXPCConnection: 0x7fd1a84f6db0> connection from pid 11011 with interface <AccountServiceInterface: 0x7fd1a84f7090> (PID 11011)
13/04/16 00:36:44,116 storeaccountd[397]: AccountServiceDelegate: Accepting new connection <NSXPCConnection: 0x7fd1a8356d70> connection from pid 723 with interface <AccountServiceInterface: 0x7fd1a83cbc90> (PID 723)
13/04/16 00:36:44,120 storeaccountd[397]: AccountServiceDelegate: Accepting new connection <NSXPCConnection: 0x7fd1a835ce50> connection from pid 723 with interface <AccountServiceInterface: 0x7fd1a83b9c90> (PID 723)
13/04/16 00:36:44,377 storeaccountd[397]: ADI: {
    Connection = "keep-alive";
    "Content-Length" = 32;
    "Content-Type" = "application/x-dmap-tagged";
    Date = "Tue, 12 Apr 2016 22:36:44 GMT";
    "Strict-Transport-Security" = "max-age=31536000";
    "apple-originating-system" = UnknownOriginatingSystem;
    "apple-seq" = 0;
    "apple-timing-app" = "13 ms";
    "apple-tk" = false;
    "server-cloud-daap-version" = "1.0";
    "x-apple-actionsignature" = "AQBQExHz3n+sGOc+z5loDuBQFPV+5QPi+plPpfkGByELAlhumedTnMCXLE4dnHvqTgbeSbMu2sRPauJeCWT5NLFtAAAAFHMsLDQ1QmLa6Sq2dnK3GiYDqYGL";
    "x-apple-application-instance" = 508755;
    "x-apple-application-site" = NWK;
    "x-apple-jingle-correlation-key" = IBFV2CN2NQDZJOP6X7SWBO7FIQ;
    "x-apple-request-uuid" = "404b5d09-ba6c-0794-b9fe-bfe560bbe544";
    "x-webobjects-loadaverage" = 0;
}
13/04/16 00:36:44,379 storeaccountd[397]: AccountServiceDelegate: Accepting new connection <NSXPCConnection: 0x7fd1a8318160> connection from pid 11011 with interface <AccountServiceInterface: 0x7fd1a83987d0> (PID 11011)
13/04/16 00:36:44,388 storeaccountd[397]: AccountServiceDelegate: Accepting new connection <NSXPCConnection: 0x7fd1a83bb6e0> connection from pid 11011 with interface <AccountServiceInterface: 0x7fd1a8041fa0> (PID 11011)
13/04/16 00:36:44,395 storeaccountd[397]: AccountServiceDelegate: Accepting new connection <NSXPCConnection: 0x7fd1a5cf7420> connection from pid 723 with interface <AccountServiceInterface: 0x7fd1a8876770> (PID 723)
13/04/16 00:36:44,433 storeaccountd[397]: AccountServiceDelegate: Accepting new connection <NSXPCConnection: 0x7fd1a8465590> connection from pid 723 with interface <AccountServiceInterface: 0x7fd1a84fa780> (PID 723)
13/04/16 00:36:44,700 storeaccountd[397]: ADI: {
    Connection = "keep-alive";
    "Content-Encoding" = gzip;
    "Content-Length" = 73;
    "Content-Type" = "application/x-dmap-tagged";
    Date = "Tue, 12 Apr 2016 22:36:44 GMT";
    "Strict-Transport-Security" = "max-age=31536000";
    "apple-originating-system" = UnknownOriginatingSystem;
    "apple-seq" = 0;
    "apple-timing-app" = "28 ms";
    "apple-tk" = false;
    "server-cloud-daap-version" = "1.0";
    "x-apple-actionsignature" = "AQDKFf5WKCyBCNkfrCVc7UMjf4+GO74VYmeRHF7g+Yfm4ZQWClVnxw0xLeMMPYVhpt/yHmC6kJBMMJgfquUWS7GmAAAAFHMsLDQ1QmLa6Sq2dnK3GiYDqYGL";
    "x-apple-application-instance" = 507001;
    "x-apple-application-site" = NWK;
    "x-apple-jingle-correlation-key" = NMUMMLQVIGQZEHSHZEQTWZ6ASA;
    "x-apple-request-uuid" = "6b28c62e-1541-a192-1e47-c9213b67c090";
    "x-webobjects-loadaverage" = 0;
}
13/04/16 00:36:44,703 storeaccountd[397]: AccountServiceDelegate: Accepting new connection <NSXPCConnection: 0x7fd1a5cf6740> connection from pid 11011 with interface <AccountServiceInterface: 0x7fd1a5c320c0> (PID 11011)
13/04/16 00:36:52,393 CalendarAgent[388]: [com.apple.calendar.store.log.caldav.queue] [Account erwinpanen@imapmail.org@https://caldav.messagingengine.com:8443/ timed out when executing operation: <CalDAVAccountRefreshQueueableOperation: 0x7fbf3fd54a20; Sequence: 0>]
13/04/16 00:36:52,430 CalendarAgent[388]: [com.apple.calendar.store.log.caldav.queue] [Coalescing failed operation [<CalDAVAccountRefreshQueueableOperation: 0x7fbf3fd54a20; Sequence: 0>]]
13/04/16 00:36:52,432 CalendarAgent[388]: [com.apple.calendar.store.log.caldav.queue] [Account refresh failed with error: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x7fbf3adc5810 {AccountName=imapmail.org@https://caldav.messagingengine.com/, CalDAVErrFromRefresh=YES, NSUnderlyingError=0x7fbf3fdaf900 "The request timed out.", NSErrorFailingURLKey=https://erwinpanen%40imapmail.org@caldav.messagingengine.com:8443/, NSLocalizedDescription=The request timed out., _kCFStreamErrorDomainKey=1, NSErrorFailingURLStringKey=https://erwinpanen%40imapmail.org@caldav.messagingengine.com:8443/, _kCFStreamErrorCodeKey=60}]
13/04/16 00:36:56,888 DEVONthink Pro[13111]: Processed 1 mail messages from “Apple Mail”; imported: 1, failures: 0, duplicates: 0

Warning: triggered scripts will activate and execute as soon as a group is selected. The results will be immediate, perhaps unexpected, and might be irreversible. Use with caution and use on your data only if you’ve tested extensively on test groups in a test database. Support and the other readers on this forum can not fix damage done by these scripts.

Triggered scripts are attached to groups, files, tags by using Tools > Show Info and using the Script dialog.

Yes, that is exactly what I have done

on triggered(the_record)
   tell application id "DNtp"
      display alert "funky"
   end tell
end triggered

I had the idea that whenever I file something to the group - it would trigger the script - and throw the message

Maybe my interpreting is wrong?

Triggered scripts are only activated when the groups or document that the script is attached is selected. Triggered scripts are covered in the DEVONthink Pro Office 2.8.10 manual, pages 111-112 of the PDF.

Greg, thanks for helping out - coincidently I was just approaching page 112 of the manual.
I guess I’ll have to read up on the example scripts.

However I’m disappointed there seems to be nothing similar as folder action scripts.

My reasoning was:

  • preferably do as much of the heavy lifting inside DTPO, build the intelligence in the groups / databases of DTPO (file away based on name, date or tag)
  • as opposed to creating multiple OS level folders and work with folder action scripts from there (which requires more thoughtfulness of the user)

Padillac’s example is just a test. On the other hand, triggered scripts make available the full power of DEVONthink’s scripting capability. They are not only “similar” to folder actions, but can actually be more effective. Triggered scripts can reach into the content of a group and make decisions about individual files. They can be applied to saved searches (i.e., smart groups) and act on the search results. Folder actions do not (easily) have that capability.

Perhaps it would be helpful if you gave a few examples of what you’re looking to accomplish with triggered scripts?

This is of course a work in progress, and I’m sure it will evolve according to how I better grasp DTPO scripting capabilities.

  1. How to achieve:
  • No matter which way you save an item to the Global Inbox - it lands there, at the same time you add a tag eg. ‘fiscal’
    => desired action would be that ‘each item tagged fiscal’ would be moved to fiscal_DB
  1. I would also like to be able to modify, or rather duplicate and modify the duplicate to have 2 additional context services.
    The ones that “Take Rich Note” and “Take Plane Note”
    I’d like to see these expanded in a way that they would either
  • pop-up the “clip to devonthink” or
  • “annotate” dialog box, or,
  • open a dialog that allows to select target DB / group and add tags.

Thanks for helping!

I would create a smart group in the global inbox that searches for that tag, then attach the triggered script to the smart group. The triggered script could either (a) be hardcoded to move each child of the smart group to a new database, or (b) prompt for destination and then move each child to the destination database/group.

This would of course be writing a service, which you can do with Automator.

As far as opening the “‘annotate’ dialog box” – I’m not sure what that is, exactly. There are dozens of contributed scripts in the forum regarding annotation. What are you referring to?

Thanks for opening my eyes…
Can be so simple, yet you don’t see it (yet)…

Here’s a screenshot of the clip to DT interface I’m referring to.