# AppleScript reminder due dates: what changed in DT4?

**URL:** <https://discourse.devontechnologies.com/t/applescript-reminder-due-dates-what-changed-in-dt4/85677>\
**Category:** DEVONthink\
**Tags:** devonthink4\
**Created:** [November 30, 2025, 12:26pm UTC](https://discourse.devontechnologies.com/t/applescript-reminder-due-dates-what-changed-in-dt4/85677 "2025-11-30T12:26:59Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdamage](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/b/e274bd/32.png) [@bdamage](https://discourse.devontechnologies.com/u/bdamage)\
**Post date:** [November 30, 2025, 12:26pm UTC](https://discourse.devontechnologies.com/t/applescript-reminder-due-dates-what-changed-in-dt4/85677/1 "2025-11-30T12:26:59Z")

</div>

In DT3, this script worked _perfectly_ — it created a reminder on the record, set to 07:00 on the 5th of the current month if the current date was the 5th or earlier, and the 1st of the next month if it was after the 5th.

```applescript
on performSmartRule(theRecords)
  tell application id "DNtp"
    repeat with theRecord in theRecords
      set theDate to current date
      if day of theDate > 5 then
        set day of theDate to 32 -- force to next month
      end if
      set day of theDate to 1
      set theDateString to (date string of theDate) & " 07:00:00"
      tell theRecord to make new reminder with properties {schedule:once, alarm:open externally, due date:theDateString}
    end repeat
  end tell
end performSmartRule

```

On DT4 it produces the error `Can’t make “Monday, December 01, 2025 07:00:00” into type date or missing value`. It seems to be objecting to the time — if I omit the `& “ 07:00:00”` everything works (except for the reminder only being set correctly if I run the script at 07:00 precisely!)

I can’t see what’s changed — the change list in the manual just mentions improvements to AppleScript, but it’s not feeling particularly improved from where I’m sitting right now 🙂

I already raised a support ticket, and since managed to make it work by setting `due date:theDate` rather than using the date string, and setting the time by the (frankly ugly) `set time of theDate to 7 * 60 * 60`but I’d prefer:

1. something that doesn’t rely on cryptic multiplications, and instead has code that clearly shows what it’s doing, and
2. to know why the old code doesn’t work any more.

Since I haven’t changed OS at the same time, it seems unlikely (for once!) that this is Apple’s doing…

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [November 30, 2025, 1:00pm UTC](https://discourse.devontechnologies.com/t/applescript-reminder-due-dates-what-changed-in-dt4/85677/2 "2025-11-30T13:00:17Z")

</div>

> [@bdamage](#):
>
> I can’t see what’s changed — the change list in the manual just mentions improvements to AppleScript, but it’s not feeling particularly improved from where I’m sitting right now 🙂

The script suite was completely rewritten with lots of additions and changes. But not every script is still compatible and therefore might need some minor changes.

> [@bdamage](#):
>
> `set time of theDate to 7 * 60 * 60`

Alternatively you could use this:  
`set {hours of theDate, minutes of theDate, seconds of theDate} to {7, 0, 0}`

---

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [November 30, 2025, 1:00pm UTC](https://discourse.devontechnologies.com/t/applescript-reminder-due-dates-what-changed-in-dt4/85677/3 "2025-11-30T13:00:52Z")

</div>

If you run

```auto
log current date

```

in Script Editor, what output do you get? I can’t try that here, because my locale is set to German.  
You could also try to use “add reminder” instead of “make new reminder”.  
Or use `set time of theDate to 7*3600` and use `theDate` instead of a string.

**Edit** I’m quite late to this party, it seems.

---

<div class="post-metadata">

**Author:** ![bdamage](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/b/e274bd/32.png) [@bdamage](https://discourse.devontechnologies.com/u/bdamage)\
**Post date:** [November 30, 2025, 1:23pm UTC](https://discourse.devontechnologies.com/t/applescript-reminder-due-dates-what-changed-in-dt4/85677/4 "2025-11-30T13:23:48Z")

</div>

@chrillek Interestingly, I get nothing at all:

 ![Screenshot 2025-11-30 at 13.13.00](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/f/1/f1eed6a8f12737da0625e9e5785d0aa8cf327250.png)

…which is bizarre, to say the least!

---

<div class="post-metadata">

**Author:** ![bdamage](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/b/e274bd/32.png) [@bdamage](https://discourse.devontechnologies.com/u/bdamage)\
**Post date:** [November 30, 2025, 1:24pm UTC](https://discourse.devontechnologies.com/t/applescript-reminder-due-dates-what-changed-in-dt4/85677/5 "2025-11-30T13:24:13Z")

</div>

Thanks — your solution definitely leaves me with a clearer idea of what the script’s trying to do the next time I look at it 👍

(_Is_ there a list of incompatibilities anywhere? It sounds like there isn’t, but it might be a good idea to collect them in one place as people run into them…)

It’s a shame the dark mode colours for the script editor haven’t changed, though — that dark blue is virtually illegible on my screen (especially since there doesn’t seem to be a way to increase the font size!)

Ideally all the syntax colours would be light when the background is dark — so light cyan instead of blue, light pink instead of purple, and light green instead of mid-green. I usually end up copying everything across to Script Debugger just to be able to read it…

 ![Screenshot 2025-11-30 at 13.16.34](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/a/a/aab1c4f8734aec7e1b2e34d0d1ea693624686c08.png)

---

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [November 30, 2025, 1:45pm UTC](https://discourse.devontechnologies.com/t/applescript-reminder-due-dates-what-changed-in-dt4/85677/6 "2025-11-30T13:45:15Z")

</div>

Turn on the protocol with Cmd-3:

 ![Bildschirmfoto 2025-11-30 um 14.44.45](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/0/8/088a67b58fdfa574c56836953cd0fa9ae1beabfe.png)

Even in Script Editor, font size and color can be modified:

 ![Bildschirmfoto 2025-11-30 um 14.45.55](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/b/0/b0f3c640988fa2847c3db95c5dea1e1315739580.png)

But I wouldn’t hold my breath waiting for Apple to fix dark mode for Script Editor.

---

<div class="post-metadata">

**Author:** ![bdamage](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/b/e274bd/32.png) [@bdamage](https://discourse.devontechnologies.com/u/bdamage)\
**Post date:** [December 1, 2025, 8:53am UTC](https://discourse.devontechnologies.com/t/applescript-reminder-due-dates-what-changed-in-dt4/85677/7 "2025-12-01T08:53:44Z")

</div>

Thanks — I get this:

**Result:**

_date_ “Monday, December 01, 2025 at 08:51:39”

I wonder if it’s the “at” that it’s wanting now?

As for the colours, I wasn’t talking about the colours in Apple’s Script Editor — I guess that would apply if you only used external scripts with DT4, but that’s a faff for inline scripts. If you edit a smart rule in DT4 that has an inline script, and click the “Edit Script…” button, DT4’s own script editor is what’s showing up with unhelpful colours. (At least Script Editor _does_ let you configure them!)

I was hoping to avoid having to copy a script from DT4 and paste it into Script Editor just to be able to read it 😁

 ![Screenshot 2025-12-01 at 08.48.37](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/7/3/73590ef7edcb11839f277721c1c3cd0c28bbf7cf.png)

---

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [December 1, 2025, 9:06am UTC](https://discourse.devontechnologies.com/t/applescript-reminder-due-dates-what-changed-in-dt4/85677/8 "2025-12-01T09:06:15Z")

</div>

There’s always light mode 😉 Perhaps DT’s script editor uses the same colors as Script Editor so that changing them in one modifies them in the other?

As to your original question: The problem seems to be solved anyway avoiding the cast to string and recast to `date` now. You can still try to do a `& "at 07:00"` in your original code, of course. The to and fro with `date` and `string` types might be more in line with AppleScript coding habits.

> [@bdamage](#):
>
> I wonder if it’s the “at” that it’s wanting now?

I doubt that. In German, the time is added with a `um` instead of `at`, and simply appending a `07:00` to the date string works ok (ie `date dateString` is “some date um 07:00”).

---

<div class="post-metadata">

**Author:** ![bdamage](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/b/e274bd/32.png) [@bdamage](https://discourse.devontechnologies.com/u/bdamage)\
**Post date:** [December 1, 2025, 9:33am UTC](https://discourse.devontechnologies.com/t/applescript-reminder-due-dates-what-changed-in-dt4/85677/9 "2025-12-01T09:33:44Z")

</div>

**AH.** _That’s_ the solution — that window is just Script Editor in a DT4-shaped trenchcoat. Thanks 👍

Changing the Script Editor settings gets me something usable in DT4. Of course, Script Editor’s background can’t be changed from white, but I tend to use Script Debugger for editing anyway.

I think I’ll leave the date handling stuff alone now that it’s working 😁

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [December 1, 2025, 10:36am UTC](https://discourse.devontechnologies.com/t/applescript-reminder-due-dates-what-changed-in-dt4/85677/10 "2025-12-01T10:36:58Z")

</div>

> [@bdamage](#):
>
> I wonder if it’s the “at” that it’s wanting now?

The `due date` expects (and always did) a date but the rewritten AppleScript support of DEVONthink 4 uses a modern `.sdef`-based script suite contrary to older versions, this might trigger subtle differences like this one. But overall the new format offers more options and improves the compatibility to JXA a lot. And version 4 includes also a new command plus examples how to add reminders:

 ![Bildschirmfoto 2025-12-01 um 11.29.49](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/f/2/f2052ce90a7fdddd2cd823a9162d5b33d204c6d4.jpeg)

And this command accepts a string:

```auto
set theDateString to (date string of theDate) & " 07:00:00"
add reminder {schedule:once, alarm:open externally, due date:theDateString} to theRecord

```

P.S: If the current day is the first of the month (like today), then the reminder created by your script is immediately triggered as it’s overdue.

---

<div class="post-metadata">

**Author:** ![bdamage](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/b/e274bd/32.png) [@bdamage](https://discourse.devontechnologies.com/u/bdamage)\
**Post date:** [December 1, 2025, 11:05am UTC](https://discourse.devontechnologies.com/t/applescript-reminder-due-dates-what-changed-in-dt4/85677/11 "2025-12-01T11:05:19Z")

</div>

Thanks!

I did know about the reminder triggering immediately if I try to set it before the 5th, but that’s deliberate to remind me to actually _do_ the thing rather than try to set reminders about it 🙂

---

<div class="post-metadata">

**Author:** ![troejgaard](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@troejgaard](https://discourse.devontechnologies.com/u/troejgaard)\
**Post date:** [December 1, 2025, 6:11pm UTC](https://discourse.devontechnologies.com/t/applescript-reminder-due-dates-what-changed-in-dt4/85677/12 "2025-12-01T18:11:18Z")

</div>

> [@bdamage](#):
>
> (_Is_ there a list of incompatibilities anywhere? It sounds like there isn’t, but it might be a good idea to collect them in one place as people run into them…)

I’m not sure I understand. Isn’t that what the scripting dictionary is for?

If an old script gives an error/unexpected result, I would run it in Script Editor and check the log to see what’s going on. Then look up the involved commands/elements/properties in DT4’s scripting dictionary to see what’s changed.

---

<div class="post-metadata">

**Author:** ![bdamage](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/b/e274bd/32.png) [@bdamage](https://discourse.devontechnologies.com/u/bdamage)\
**Post date:** [December 3, 2025, 1:41pm UTC](https://discourse.devontechnologies.com/t/applescript-reminder-due-dates-what-changed-in-dt4/85677/13 "2025-12-03T13:41:25Z")

</div>

The thing about the scripting dictionary is that it doesn’t show a list of changes — it just shows what it now _is_, and you have to spot that something’s different. Especially when `Can’t make “Monday, December 01, 2025 07:00:00” into type date or missing value` is the sum total of what appears in the log (because I _did_ already look there, and posted what I found in the first post 🙂)

If you can look at the “reminder” page’s “due date” entry, and click through onto the definition of “date”, and see what changed between DT3 and DT4, then you’re better at this than me!

When I mentioned a list of incompatibilities, I was thinking more along the lines of a table with two columns: “what it was in DT3”, and “what you need to do instead in DT4” — something people could find the answers in _quickly_ so they could get things working again.
