deleting Macintel desktop aliases

Ken Ray kray at sonsothunder.com
Mon Sep 4 18:31:15 CDT 2006


On 9/4/06 5:26 PM, "Shari" <shari at gypsyware.com> wrote:


> As for revXXX things... I still do not understand.  The engine is the
> same regardless, right?  The only difference between Rev 2.7 and MC
> 2.7 is the IDE, the user interface.  So there must be libraries or
> stacks that contain the special revXXX items, that I could add to my
> stack to make them work?

Yes, there are rev libraries you could work with (revDeleteFolder is in the
script of btn "RevCommon" of group "RevLibraries" of the first card of the
stack file "revlibrary.rev" in the Toolset folder) , or you could copy the
code you need from the Rev library (for example, 'revDeleteFolder' is in the
revCommon backscript (open the message box in Rev, click on the Backscripts
button).

Alternatively you could try my "stsDeleteFolder" command (plus the
stsFormatPath function if you need Windows functionality) to see if that
works for you:

on stsDeleteFolder pFolder
  -- WARNING: THIS DELETES A FOLDER AND ALL THE FILES IT CONTAINS... USE
WITH CAUTION!
  switch (the platform)
  case "MacOS"
    if isOSX() then
      get shell("rm -rf" && q(pFolder))
    else
      -- TBD for OS 9
    end if
    break
  case "Win32"
    if char 1 of word 2 of the systemVersion = "5" then
      get shell ("rmdir /s /q" && q(stsFormatPath(pFolder,"Win32")))
    else
      get shell ("deltree /Y" && q(stsFormatPath(pFolder,"Win32")))
    end if
    break
  end switch
end stsDeleteFolder

function q pWhat
  return quote & pWhat & quote
end q

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

function stsFormatPath pPath,pPlatform
  -- assumes a full "/"-delimited path
  switch pPlatform
  case "MacOSX"
  case "Unix"
    put "\" & space & quote & "'`<>!;()[]?#$^&*=" into tSpecialChars
    repeat for each char tChar in tSpecialChars
      replace tChar with ("\" & tChar) in pPath
    end repeat
    break
  case "Win32"
    set the itemDel to "/"
    put item -1 of pPath into tFile
    put "\/:*?" & quote & "<>|" into tSpecialChars
    repeat for each char tChar in tSpecialChars
      replace tChar with ("-") in tFile
    end repeat
    put tFile into item -1 of pPath
    replace "/" with "\" in pPath
    break
  end switch
  return pPath
end stsFormatPath


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




More information about the metacard mailing list