Here's an example for GIMP:
Code:
#!/bin/bash
printf "<?xml version=\"1.0\" encoding=\"UTF-8\"?><openbox_pipe_menu>"
# Instead of just "gimp" in the next line, it could even be a series of
# related programs, if you juggle between different applications with
# these files. Such as "gimp\|inkscape\|krita\|mypaint"
grep -B 10 gimp ~/.local/share/recently-used.xbel | \
...