View Full Version : Writing Cross Platform: How can I use getsep()?

11-27-2012, 04:18 PM
I am attempting to augment the file on this page, http://forums.newtek.com/showthread.php?126411-Official-support-for-backburner/page3&highlight=backburner,
with the ablility to write on a Mac, as well.
From what I can ascertain, all the \ aren't being read correctly when received on a Mac. The script gets to here, it seems, but never gets to the "File submitted..." dialog. I surmise it is because the file is never written.

How might I get it to work in a mixed platform environment?

I appreciate any and all insight. Thank you.

11-27-2012, 04:35 PM
Getsep() looks to return the separator that's specific to the system that the lscript is being run on. My guess is that you would feed the returned value into a variable so you can use that for a condition check. What I would do is get the path to the file, check what separators are there and use that to build the necessary file path and name that you need.

11-27-2012, 09:46 PM
Nick Digital is correct, getsep() let's you know what the system path separator is, e.g:

sep = getsep();

You can also double check you're on mac like so:

if (platform == MACINTOSH | platform == MACUB )
operatingSystem = "Mac";
operatingSystem = "PC";

12-01-2012, 09:43 AM
Annoyingly, that's not the full answer. At least, on Mac64, MACUB (integer value of 9) is not defined as the platform - the integer value of PLATFORM for any Cocoa LW builds in 64-bit mode appears to be 11. This isn't documented *anywhere*. Not in the SDK, not in the LScript docs. There doesn't seem to be a corresponding variable pre-defined, that I can find. It doesn't look like the documentation for this has been updated at all.

MACINTOSH only flags on CFM LW. You could differentiate CFM LW from UB LW by testing for MACINTOSH or MACUB. That won't help on Mac64, which is the dominant mode for LW to be run in without user intervention since 9.6.1 was released.