drag n drop

Ken Ray kray at sonsothunder.com
Thu Mar 31 14:24:39 EST 2005


On 3/31/05 12:44 PM, "Thomas McGrath III" <3mcgrath at adelphia.net> wrote:

> much appreciated.....
> 
> How can I open a folder on the users desktop???

Here's a way I use:

on stsOpenFolder pPath
  switch (the platform)
  case "Win32"
    set the hideConsoleWindows to true
    if the shellCommand is "cmd.exe" then
      create alias "C:/Temp.lnk" to file pPath
      get shell("C:\Temp.lnk")
      delete file "C:/Temp.lnk"
    else
      get shell("start" && quote & pPath & quote)
    end if
    break
  case "MacOS"
    if isOSX() then
      get shell("open " & pPath)
    else
      put "tell application " & quote & "Finder" & quote & cr & \
          "activate" & cr & \
          "open folder " & quote & revMacFromUnixPath(pPath) & quote & \
          cr & "end tell" into tScript
      do tScript as AppleScript
    end if
    break
  end switch
end stsOpenFolder 

function isOSX
  set the itemDel to "."
  return (item 1 of the systemVersion >=10)
end isOSX




More information about the use-livecode mailing list