Hidden Preferences script: missing value?

I’m trying to access hidden preferences and choosing scripts - tabs - open hidden preferences doesn’t do anything. If I open the script and run it, I get the error “missing value”

I’m running DT 3.9.8 on MacOS Sequoia 15.3.1

appreciate any help you can give me.

This is what’s In the script:

– Open Hidden Preferences
– Created by BLUEFROG/Jim Neumann on Mon Oct 07 2024
– Copyright 2024 DEVONtechnologies, LLC. All rights reserved.

(* Due to changes in macOS Sequoia, URL schemes in the Tips.app no longer work. This script gives access to the hidden preferences.
Note: You can only change settings with On/Off options. Read the preamble to the section if you need to change other settings, e.g., AdditionalPlainTextExtensions. *)

tell application id “DNtp”
set hiddenPrefs to (“file://” & POSIX path of (path to it as string) & “Contents/Resources/DEVONthink.help/Contents/Resources/pgs/appendix-hiddenpreferences.html”)
set encodedURL to (do JavaScript “encodeURI("” & hiddenPrefs & “")”) in think window 1
open tab for URL encodedURL
end tell

The code is bogus, since you posted it as text – it uses curly quotes where straight quotes are required and mixes curly and straight quotes in other places. Please enclose code in three backticks like so

code goes here

I don’t know where this script comes from and don’t see it in my script menu.
This variant works for me:

tell application id "DNtp"
	set hiddenPrefs to ("file://" & POSIX path of (path to it as string) & "Contents/Resources/DEVONthink.help/Contents/Resources/pgs/appendix-hiddenpreferences.html")
	set encodedURL to (do JavaScript "encodeURI('" & hiddenPrefs & "')") in think window 1
	open tab for URL encodedURL
end tell
2 Likes

Christian, this is what I see in the menu item “Open Hidden Preferences.scpt”

-- Open Hidden Preferences
-- Created by BLUEFROG/Jim Neumann on Mon Oct 07 2024
-- Copyright 2024 DEVONtechnologies, LLC. All rights reserved.

(* Due to changes in macOS Sequoia, URL schemes in the Tips.app no longer work. This script gives access to the hidden preferences.
Note: You can only change settings with On/Off options. Read the preamble to the section if you need to change other settings, e.g., AdditionalPlainTextExtensions. *)

tell application id "DNtp"
	set hiddenPrefs to ("file://" & POSIX path of (path to it as string) & "Contents/Resources/DEVONthink.help/Contents/Resources/pgs/appendix-hiddenpreferences.html")
	set encodedURL to (do JavaScript "encodeURI(\"" & hiddenPrefs & "\")") in think window 1
	open tab for URL encodedURL
end tell

Where did I get it from - I guess something Jim posted at some point?

Does DEVONthink have its Automation permissions and Full Disk Access enabled in System Settings > Privacy & Security?

you can download it from scripts > more scripts

Yes and yes

Chrillek - Thanks for the tip - I just did a cut and paste

If you’re still having an issue, reboot the machine and see if it persists. You’re the first person to report an issue on it.

The paste part was probably causing the issue. I suppose that the discourse software tries to be “smart” about quotes. Which is the opposite in the context of code

Ugh - rebooted and no change. Maybe I’m looking for the wrong thing. I’m expecting some type of window to open with additional preferences in it. Is something else supposed to happen?

A window opens displaying the part of the documentation that describes the hidden preferences. In this window, you can click on the ON/OFF prefs.

Alternatively, just copy/paste the command from the user’s manual in an open Terminal window.

Well, I’m not having any luck here. Figure it must be a permissions thing, but no idea which permissions. If I run the script in script editor, the log gives me this:

What do you see in the Events tab?

Also, you have apparently installed DT in a non-standard location, i.e. in ~/Applications instead of /Applications. Why? And do you see the same problem if you move DT to /Applications

Thank you. I try to instal all non-apple apps in my local application folder. Mostly paranoia and ease of use. I have a separate admin account on the machine to prevent me from doing stupid stuff when it’s late and I’m tired. So putting non-apple apps in my local folder adds one more layer of protection for me.

I moved it back to /Applications. Same challenge.

“Moving” or re-installing?

I’d love to see the code together with the events log. Something is off here, if do JavaScript returns an empty string in this context.

Also, do you have any “security” software installed like virus scanners and the like?

I have no clue how you’re getting the replies you are.

path to current application points to Script Editor, not DEVONthink. And just repeating it should have no different effect.

Does Script Editor have Full Disk Access?

Try this…

tell application id "DNtp" to open tab for URL "file:///Applications/DEVONthink%203.app/Contents/Resources/DEVONthink.help/Contents/Resources/pgs/appendix-hiddenpreferences.html"

here’s the code to go with the events log. there’s no security software.

move

script editor has full disk access. running the tell opens this window, which is what I think I’m supposed to get: