how am i to know which current directly are they using?
Your script can make use of the Cwd module for that. (But, as stated elsewhere, the best approach is to use a full path to frame.txt instead of the relative path that you have been using. When you use a full path it doesn't matter where the current working directory is.)