Out of curiosity, why do you not write a shell script that changes the directory to the directory its located at, then does the command? And execute that shell script from your home directory or something?
Sorta like this (with this being stored in a file, such as
execute-foremost.sh, set to be executable, and stored wherever):
That should accomplish the same thing, assuming you execute the script from the command line. Although the title might not be what you want it to be, it'll get most of what you need done.
I've edited the script to use the path to foremost rather than changing directories to the location that foremost is stored in. This should then spit you back out to wherever you stored the shell script.