Saw there was a problem in October, have a similar problem.
Trying to save a file into a different folder than the one I’m working in.
Working in the Member_X folder, want to Save to ThanksData folder.
Your HFS path starts with a colon, meaning this path is relative to the active database; it is starting from the folder where your database is sitting.
So the result of the unixpath( function is calculated correctly, but the path is wrong.
I seem to be getting a reputation for doing the impossible:face_with_raised_eyebrow:
Tried it with and without the colon at work and got the same result.
Just tried it at home where I’m on El Capitain and got the same result. The folders are set up a little different at home, but that shouldn’t matter with the below code.
Back at work with High Sierra. Your method does produce the expected result. But there is something buggy, or at least not what I expect, using unixpath(
Results in this:
/Users/martin older/Documents//Users/martin older/Documents/CAPRI WORK/MEMBERDB_X/CAPRI WORK/FUNDRAISING/SEATS 2017/LETTERS SENT/ThanksData
I haven’t tried running from different locations, say not in the documents folder, but it appears unixpath( automatically is adding the path to the Documents folder.
You never want to do that. The unixpath( function automatically adds the path to the currently active database, resulting in a complete path. If you stick something else on the beginning, you’ll definitely get a wrong path.
Like Kurt, I think you are making some kind of user error, but I can’t tell what it is without seeing the entire structure of your hard disk, and where the current database is positioned within that structure.
In any case, the unixpath( function is really only included for compatibility with Panorama 6, where it was usually used for setting up shell commands or code in an AppleScript. I would recommend not using this function, it’s really not needed any more, as shown by Kurt’s example. In my own applications, I also avoid using hfs format paths (with colons). They work, but it can be confusing, I find it simpler to switch over to using unix paths everywhere.