 <p>Okay, I figured this out myself.</p> <p>The name of the file that was right-clicked on is sent as an argument, and the working directory is set to the user's home.</p> <p>My problem was caused by my program trying to work on two different targets simultaneously: the file name sent to it by the file manager, and my (irrelevant) home directory. I specified a new target directory myself and it works fine now.</p> <p>EDIT: This might be specific to TCL. If that is the case, then I apologize for posting this question.</p>