Newbies pagyo Posted April 5, 2013 Newbies Posted April 5, 2013 Hi. We've been playing around with ScriptMaster and think it's pretty nifty. However, we build a script that looks at a folder and then provides a list of the files within it. But, when we run the script on Mac, 2 things happen. 1. The path used by the function does not start in the drive where the FM file resides. It starts at the root of the hard disk. This makes us have to determine the path before we can list the files. 2. When we do list the files... the name isn't just listed, but also the path... so we get a list of names like this: /Macintosh HD/users/me/OurFile/invoice.csv /Macintosh HD/users/me/OurFile/invoicelines.csv On windows, it'll provide a nice clean list: invoice.csv invoicelines.csv So why is it like this?
Ddoughtie Posted May 20, 2013 Posted May 20, 2013 I sort of agree. I too see the full path on a Mac but I'm also seeing it on on Windows Server 2008 R2 (I'm running a script from FMSA12). I'm capturing the lists in a non-global field so I can see the results. So to get around it I tried to do a substitute (get(documentsPath)) and strip out the path. But the problem with that is that the plugin is returning the path with backward slashes and lacks a beginning slash. The Get(DocumentsPath) is returning the path with forward slashes and a starting slash. So before I can strip out the path and get just the file name I have to reverse the slashes and remove the first one. Not to mention on the Mac you have to strip out the Volume Name but not on Windows. I find this annoying but that is true for every plug-in I've ever tried. I added if statements to use different substitutions based on platform because I am working in mixed environment. (This is my first time using ScriptMaster and I have to say I do like it).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now