In any case here's the code (from the workflow linked above) - it's a pretty trivial bit of AppleScript - the function call is just there b/c I had it lying around.
on alfred_script(q)
click_menu("Finder", "Window", "Merge All Windows")
end alfred_script
on click_menu(app_name, menu_name, menu_item)
try
tell application app_name
activate
end tell
tell application "System Events"
tell process app_name
tell menu bar 1
tell menu bar item menu_name
tell menu menu_name
click menu item menu_item
end tell
end tell
end tell
end tell
end tell
return true
on error error_message
return false
end try
end click_menu