dragData["files"] problem

Ken Ray kray at sonsothunder.com
Fri May 26 02:37:21 EDT 2006


On 5/25/06 11:04 PM, "J. Landman Gay" <jacque at hyperactivesw.com> wrote:

> Maybe someone else can come up with a better way, or fix this one. Or
> there may be an Applescript function that allows you to get the long name.

Yes, there is... here's my stsLongFilePath function in action:

on dragDrop
  put the dragdata["files"] into tPath
  put stsLongFilePath(tPath) after fld 1  -- or
end dragDrop

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

Enjoy!


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list