revCopyFolder and long file names

Ian Wood revlist at azurevision.co.uk
Tue May 22 14:56:47 EDT 2007


On 21 May 2007, at 23:59, Ken Ray wrote:

> Actually the 'revCopyFolder' command uses AppleScript under the  
> hood to
> do its business, and this is why you get an 'execution error'. The
> problem is that Rev doesn't maintain the long file name as it is, but
> in its "hashed" state. This is something Rev can work with and not  
> have
> a problem with (which was the bugs that were fixed). The problem is
> that when the hashed path is put into an AppleScript statement,
> AppleScript chokes. So I'd suggest using my handy-dandy
> "stsLongFilePath" function:

This is with Rev 2.8.1, I've already got the long file name - your  
handler is returning exactly the same path that was passed to it, and  
revCopyFolder is still failing with an execution error. :-(

For now I'm using the shell workaround that Sean has added to the bug  
report.

Ian

> function stsLongFilePath pPath
>   switch (the platform)
>   case "MacOS"  -- assumes OS X
>     put "set tPath to" && quote & pPath & quote & cr & \
>         "set tPath to (POSIX file tPath) as string" & cr & \
>         "POSIX path of tPath" into tScript
>     do tScript as "AppleScript"
>     return (char 2 to -2 of the result)  -- strips quotes
>     break
>   case "Win32"
>     return the longFilePath of pPath
>     break
>   end switch
> end stsLongFilePath
>
> So you can then do:
>
>   revCopyFolder stsLongFilePath(tSrc),stsLongFilePath(tDest)
>
> And all should be well...  :-)



More information about the use-livecode mailing list