Default database setting?

I could have sworn that i used to be able to select a default database in database properties. That seems to be gone now.
I want to change a script from set theDatabase to the current database
set theDatabase to the default database

If that isn’t an option, can I just do “set theDatabase to database name” and do I need quotes around the name if there are multiple words?

As far as I know there never was such a setting.

tell application id "DNtp"
		set theDatabase to database "_temp"
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
	end try
end tell

You always have to use quotes for every literal string. Without quotes you’re creating an undefined variable.

Sorry a bit confused with what that script is doing?

Database is called Devonthink 2020
I don’t want to change it to Devonthink2020 or it will mess up rules and scripts.
I tried "set theDatabase to database “Devonthink 2020” and the script didn’t run.

You don’t need to change the name. It’s the correct way to set a database in AppleScript, no idea why it doesn’t work for you. Ah - the database has to be open.

There was a default database in DEVONthink 2 bug that was many, many years ago.

1 Like

Thanks Pete, it is working now after restarting DT and DA (it was DA calling the script).

1 Like