Rewind by 15 seconds or skip by 15 seconds the audio transcript within the Notes App

Hi!

After tinkering with AppleScripts (and some insight from ChatGPT to properly target buttons), these are 2 scripts :

  • One for +15 seconds (that I'll bind to F10)
  • One for -15 seconds (that I'll bind to F8)

For +15 seconds:

tell application "System Events"
	tell process "Notes"
		set theGroup to group 1 of group 1 of splitter group 1 of window 1
		set btns to every button of theGroup

		#idk how many buttons there are but I'm looking for at least 3 (that could match rewind, play/pause, skip)
		if (count of btns) ≥ 3 then
			# button 1 = closes the recording tab
			# button 2 = rewinds by 15 seconds 
			# button 3 = play/pause 
			# button 3 = skips by 15 seconds
			# button 5 = toggle between transcription/audio wave displays of the recording tab
			click item 4 of btns
		end if
	end tell
end tell

For -15 seconds:

tell application "System Events"
	tell process "Notes"
		set theGroup to group 1 of group 1 of splitter group 1 of window 1
		set btns to every button of theGroup

		#idk how many buttons there are but I'm looking for at least 3 (that could match rewind, play/pause, skip)
		if (count of btns) ≥ 3 then
			# button 1 = closes the recording tab
			# button 2 = rewinds by 15 seconds 
			# button 3 = play/pause 
			# button 3 = skips by 15 seconds
			# button 5 = toggle between transcription/audio wave displays of the recording tab
			click item 2 of btns
		end if
	end tell
end tell

Good luck with it!

Figured I'd toss this screenshot to illustrate the "buttons"