Convert Path strings to POSIX strings

Brahmanathswami brahma at hindu.org
Mon Nov 18 20:32:10 CET 2013


Those functions only deal with colons --> slashes and back

But I was looking to auto escape "bad chars" for Javascript

This apple script works:

get POSIX path of "/Volumes/Varuna/Art Storage/*Archives/Other art/Lotus 
/Google Image Result for 
http___f33.yahoofs.com_mapann_1000_sr_22692099138f2f.jpg%3Flc_____DWcnzQJ1P.jpg"


but my result is not what I expected: it is unchanged.

the *Asterisk and the percent sign in  the path are unchanged.
I thought POSIX conversion would do something with those, but it doesn't.

I'm still missing something...


mark wrote:
>
> Have a look at revMacFromUnixPath and revUnixFromMacPath.
>
> --
> Best regards,
>
> Mark Schonewille
>
>
Brahmanathaswami wrote:

Can we convert path strings like this (complete mess! but OSX accepts them, but later they break other apps....)

"/Volumes/Varuna/Art Storage/*Archives/Other art/Lotus /Google Image Result for http___f33.yahoofs.com_mapann_1000_sr_22692099138f2f.jpg%3Flc_____DWcnzQJ1P.jpg",


"/Volumes/Varuna/Art Storage/*Archives/Other art/Lotus /Google Image Result for http___img2.etsystatic.com_il_570xN.248471862.jpg.jpg",


to POSIX strings using Livecode?  I know I can do it with AppleScript but I want to pass them as POSIX strings to a Javascript (I don't even know if javascript will accept POSIX strings as input to JSON type variable... )

I tried to do my homework on this, but I'm not sure I even understand yet what a POSIX string is!




More information about the use-livecode mailing list