AppleScript to Select Contextual Menu Item on GarageSale Folder?

I am wanting to create a AppleScript that will trigger a contextual menu within GarageSale and select the option “Sort By Title”.

The left scrollable column consists of a series of eBay listing and / or folders which can contain other folders and / or eBay listings.

Right clicking on a folder will bring up a contextual menu on which there is an option to sort the contents of the folder in ascending order according to the titles of the subfolders or eBay listings inside. Holding the option key down when the “Sort By Title” is selected will sort the items in descending order.

Ideally the script would work with whatever folder is selected as opposed to having to hardcode the specific handle of a folder into the script.

I have included a screenshot of the Accessibility Inspector when one of these folders is selected.

I found a script that does something similar within TextEdit, but can’t get it to work with GarageSale 9.8.1 due to various errors. I am having problems with figuring out what specifically to target.

tell application "TextEdit" to activate
tell application "System Events" to tell application process "TextEdit"
	tell window 1 to tell scroll area 1
		click
		tell text area 1
			perform action "AXShowMenu"
			set menuTemsNames to name of menu items of menu 1
			click menu item "Paste" of menu 1
		end tell
	end tell
end tell

Can only embed one image per post so added Inspector image here so its big enough to read.

The following attempt creates a “Expected end of line but found identifier.” error on the word “action”

tell application "GarageSale 9.8.1" to activate

tell application "System Events" to tell application process "GarageSale 9.8.1"
	
	--tell NSSplitView of window 1 to tell NSSCrollArea of window 1 to tell GSOutlineView of window 1 to tell NSOutlineRow of window 1 to tell NSTableViewCellMockElement of window 1 to tell NSTextFieldCell of window 1 to tell NSTextFieldCell of window 1
	tell window 1 to tell "split group 1" to tell "scroll area 1" to tell "outline 1" to tell "outline row 5" to tell "cell 1"
		
		click
		
		tell NSTextFieldCell
			perform action "AXShowMenu"
			set menuTemsNames to name of menu items of menu 1
		end tell
	end tell
	
end tell

Your script above won’t execute.
You have the up element types in between the quotes as text.

The line

tell window 1 to tell “split group 1” to tell “scroll area 1” to tell “outline 1” to tell “outline row 5” to tell “cell 1”

Should be

Tell UI Element 1 of row 5 of outline 1 of scroll area 1 of splitter group 1 of window 1

Cell is not a valid gui term, must use the generic UI Element instead