Switch to mounted filesystem automatically

Whenever I make an AppImage using appimagetool I need to add the line cd "(dirname "$0")" if I want to execute other files in the AppDir which only works if the AppRun is made as a bash script, also it seems clunky having to type that every time I need to make a new appimage. Would it be possible to make it automatically switch to the location that is mounted? this would make interacting with other relative files much easier. Or I could be missing something crucial (I only learned how to make appimages by trial and error anyway) if so please tell me.

Edit: Never mind, I just found out about the $APPDIR variable which makes things much easier. As suspected it just was me missing something in the documentation. :stuck_out_tongue: