CopyMoveFile ( ~OriginalFilePath ; ~EndFilePath ; ~MacServerPath ; ~PCServerPath ; ~MoveOrCopy )
Move or Copy a file in Finder or Explorer using CMD or Terminal commands
Average rating: 5.0 (3 votes) Log in to vote
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
In my work I move lots of files around for printing and sometimes need to switch between platforms. I was sick of using my separate custom functions for doing this and having to re-program.
Now I can use 1 custom function. I can make a variable and pass it to BOTH an Applescript AND a Send Event step and, regardless of the platform, I will have a correctly formatted terminal command to run in the script step that works on that platform.
The only bit that is not obvious is the "~MacServerPath ; ~PCServerPath ;".
You will have "different" beginnings to a Mac and Windows address for the same file. For example;
Therefore I use the substitute command where I would (in this case) replace "/Volumes/DataServer/" with "x:/" were I going onto a PC but the path was formed on the Mac (and the opposite).
90% of the time this step is unnecessary so I just put " 1 ; 1 ;" in there if the solution is a single platform job and it cancels itself out.
PS. This is my first upload, any constructive criticism would be appreciated
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.