I was able to get the context menu up with applescript tell perform action "AXShowMenu"
tell application "System Events" to tell process "Finder" tell window {window name} tell splitter group 1 tell splitter group 1 UI elements tell scroll area 1 UI elements tell group 1 UI elements tell image {filename} perform action "AXShowMenu" end tell end tell end tell end tell end tell end tell
This got the menu up. But I am not able to access any of the menu items. How can I access menu items for a file in finder?