How to get a page number in Skim?

I’m trying to write a Keyboard Maestro macro to open a PDF, search for a string, and open a corresponding PDF at the same page where the string is found in the first PDF.

Currently I’m missing a script (or other solution) to determine the number of the page where the search string in Skim has been found first.

Is this possible at all?

I’d also be happy with a script to navigate to page n in a PDF opened in Skim.

This works for task #2:

given n = 3

tell application "Skim"
	tell document 1
		
		go to page 3
	end tell
end tell