Moving Results from Globals/Inbox to MyDatabase/TodaysDate

I am brand new to DevonAgent and DevonThinkPro and also new to Mac. I am a recently converted Windows user… :wink: I am using DA and DT to conduct automated web research that I want to archive and access remotely through the iPad app. Based on what I have read in the manuals and online, I have been able to create an automated script that runs my query in DevonAgent and dumps it in the Global Inbox of DevonThinkPro. I want the information to be moved from the global inbox to a new group that is created each day in my database. I’ve been playing around with the scripting language and haven’t been able to figure out how to create a new group unless I am have my database open. I want to be able to create the new group regardless where I am in DT… So far, I have this… I’m manually selecting the records I want to move at this point. I want to eventually use the Modified date to select them.

tell application id "com.devon-technologies.thinkpro2"
		set this_selection to the selection
		set the_destination to "MyDatabase"
		open database the_destination
		set the_folder to create location "/TodaysDate"
		if this_selection is {} then error "Please select some contents"
		repeat with this_record in this_selection
				move record this_record to the_folder
		end repeat
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
	end try
end tell

I get this result

tell application "DEVONthink Pro"
	get selection
		--> {content id 101024 of database id 1}
	open database "MyDatabase"
		--> missing value
	create location "/TodaysDate" in "MyDatabase"
		--> parent id 106321 of database id 1
	move current application record content id 101024 of database id 1 to parent id 106321 of database id 1
		--> content id 101024 of database id 1
end tell

Can anyone assist me in getting on the right track?


Your database is not opening. To open a database:

tell application id "com.devon-technologies.thinkpro2"
	open database "/Users/Me/Documents/DEVONthink Databases/My Database.dtBase2"
end tell

open database is looking for the POSIX file path of the database

Thank you!