Help with AppleScript and devonthink field names

Hi. Im writing a macro using both keyboard maestro and AppleScript to fill in programmatically a new note. I am struggling to understand how to refer (ie fill) the geolocation field. I have managed to fill in the name, URL etc but cant understand how to do so for the `geolocation field. This is the current section

		set theRecord to create record with {name:theClipboard, geolocation:LongLat, URL:LongLat, type:markdown, source:"# " & (the clipboard)} in theGroup

any idea? this is the full AppleScript btw

tell application "Keyboard Maestro Engine"
	set LongLat to getvariable "longlat"
end tell

-- Create markdown record in specific group

tell application id "DNtp"
	try
		
		set theGroup to (get record with uuid "71A39E6F-DA44-4FBE-91C7-5E198D25122E") -- this is an UUID. Copy the Reference URL via the menu and delete everything before (and including) "://"
		
		set theClipboard to the clipboard
		
		set theRecord to create record with {name:theClipboard, geolocation:LongLat, URL:LongLat, type:markdown, source:"# " & (the clipboard)} in theGroup
		-- set theRecord to create record with {name:"Test", type:markdown, source:"#"} in theGroup
		
		set label of theRecord to 1 -- not sure which label is "todo" 
		
		-- create a new markdown record
		
		
		#open window for record theRecord -- uncomment if you want to open the new record
		#activate
		
		#open window for record theGroup -- uncomment if you want to open the group
		#activate
		
	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

Also I created a keyboard maestro macro to strip away lat/long from google map links which I can share gladly if anyone has interest?

best

Z

updating also tried the local longitude/latitude variables with no success. See:

tell application "Keyboard Maestro Engine"
	set Long to getvariable "longvar"
	set Lat to getvariable "latvar"
	set Currenturl to getvariable "SecondURL"
end tell

-- Create markdown record in specific group

tell application id "DNtp"
	try
		
		set theGroup to (get record with uuid "71A39E6F-DA44-4FBE-91C7-5E198D25122E") -- this is an UUID. Copy the Reference URL via the menu and delete everything before (and including) "://"
		
		set theClipboard to the clipboard
		
		set theRecord to create record with {name:theClipboard, latitude:Lat, longitude:Long, URL:Currenturl, type:markdown, source:"# " & (the clipboard)} in theGroup
		-- set theRecord to create record with {name:"Test", type:markdown, source:"#"} in theGroup
		
		set label of theRecord to 1 -- not sure which label is "todo" 

thx

Z

tell application id "DNtp"
	set thisRecord to create record with {name:"new file", type:markdown, content:"hi"} in current group
	set latitude of thisRecord to "26.177624"
	set longitude of thisRecord to "-81.806946"
end tell

The next release will support this syntax too.

thx both @BLUEFROG and @cgrunenberg!

since im super new, how often do releases happen?

best

Z

We don’t comment on development timeframes. We don’t make tiny little point updates, but we also don’t make one or two massive updates per year.