Hi,
On MacOS you need to use the full file path, including the name and file extension, e.g.:
/Users/YourName/Documents/Programming/Projects/new/test.pas
In the Finder window, select the respective file. At the bottom of the window you'll find the breadcrumb path. Right click on the file name and click "Copy 'test.xyz' as Pathname".
Paste the copied path into your code.
see attached example of the breadcrumb.