#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@" revAltFileMgr 3 T tG altFileMgr G U Lucida Grande U Lucida Grande U Lucida Grande W Lucida Grande cREVGeneral debugObjects Pon resizeStack pNewW,pNewH,pOldW,pOldH --> AUTO-GENERATED BY altLayout Manager altSetRect (long ID of field "theFiles"), (the altLayoutManager["altCmd"] of long ID of field "theFiles") altSetRect (long ID of field "theFolder"), (the altLayoutManager["altCmd"] of long ID of field "theFolder") altSetRect (long ID of button "show invisible files"), (the altLayoutManager["altCmd"] of long ID of button "show invisible files") altSetRect (long ID of button "visible"), (the altLayoutManager["altCmd"] of long ID of button "visible") altSetRect (long ID of field "thePath"), (the altLayoutManager["altCmd"] of long ID of field "thePath") altSetRect (long ID of button "Rename"), (the altLayoutManager["altCmd"] of long ID of button "Rename") altSetRect (long ID of field id 1015), (the altLayoutManager["altCmd"] of long ID of field id 1015) altSetRect (long ID of field "vers"), (the altLayoutManager["altCmd"] of long ID of field "vers") end ResizeStack --> END AUTO-GENERATED BY altLayout Manager on OpenStack --> AUTO-GENERATED BY altLayout Manager stripandship start using stack "altLayoutLib" initAltLayoutLib end OpenStack on renamePath put fld "theFolder" & line (the hilitedline of fld "theFiles") of fld "theFiles" into tOldPath put fld "thePath" into tNewPath set itemDel to "/" put last item of tNewPath into tNewName if last char of tOldPath is "/" then put "/" after tNewName --> MAKE FILE / FOLDER NAME if the hilite of btn "visible" then if char 1 of tNewName is "." then delete char 1 of tNewName end if else if char 1 of tNewName is not "." then put "." before tNewName end if end if delete last item of tNewPath if last char of tNewPath is "/" then delete last char of tNewPath put tNewPath & "/" & tNewName into tNewPath put "mv" && tOldPath && tNewPath into tCommand get shell(tCommand) loadFolder fld "theFolder" end renamePath on disableProps pBool if pBool is true then disable btn "visible" disable btn "Rename" disable fld "thePath" unhilite btn "visible" put empty into fld "thePath" else enable btn "visible" enable btn "Rename" enable fld "thePath" hilite btn "visible" end if end disableProps on loadFolder pFolder if pFolder is empty then answer folder "choose a folder" with fld "theFolder" if it is empty then exit to top put it into pFolder end if put the defaultFolder into tOldDF set the defaultFolder to pFolder put shell("pwd") into tDefaultFolder delete last char of tDefaultFolder if last char of tDefaultFolder is not "/" then put "/" after tDefaultFolder put tDefaultFolder into fld "theFolder" if the hilite of btn "show invisible files" then put shell("ls -a -p") into tResponse else put "./" &cr& "../" &cr& shell("ls -p") into tResponse end if if tResponse contains "ls: .: Permission denied" then put "./" &cr& "../" &cr before tResponse delete last char of tResponse put tResponse into fld "theFiles" set the defaultFolder to tOldDF disableProps true end loadFolder on stripAndShip disableProps true put "" into fld "theFolder" put "" into fld "theFiles" put "" into fld "thePath" end stripAndShip G cREVGeneral scriptChecksum d^ck~) bookmarks handlerList EresizeStack OpenStack renamePath disableProps loadFolder stripAndShipscriptSelection char 1066 to 1065prevHandler OpenStacktempScript script
on resizeStack pNewW,pNewH,pOldW,pOldH --> AUTO-GENERATED BY altLayout Manager
altSetRect (long ID of field "theFiles"), (the altLayoutManager["altCmd"] of long ID of field "theFiles")
altSetRect (long ID of field "theFolder"), (the altLayoutManager["altCmd"] of long ID of field "theFolder")
altSetRect (long ID of button "show invisible files"), (the altLayoutManager["altCmd"] of long ID of button "show invisible files")
altSetRect (long ID of button "visible"), (the altLayoutManager["altCmd"] of long ID of button "visible")
altSetRect (long ID of field "thePath"), (the altLayoutManager["altCmd"] of long ID of field "thePath")
altSetRect (long ID of button "Rename"), (the altLayoutManager["altCmd"] of long ID of button "Rename")
altSetRect (long ID of field id 1015), (the altLayoutManager["altCmd"] of long ID of field id 1015)
altSetRect (long ID of field "vers"), (the altLayoutManager["altCmd"] of long ID of field "vers")
end ResizeStack --> END AUTO-GENERATED BY altLayout Manager
on OpenStack --> AUTO-GENERATED BY altLayout Manager
stripandship
start using stack "altLayoutLib"
initAltLayoutLib
end OpenStack
on renamePath
put fld "theFolder" & line (the hilitedline of fld "theFiles") of fld "theFiles" into tOldPath
put fld "thePath" into tNewPath
set itemDel to "/"
put last item of tNewPath into tNewName
if last char of tOldPath is "/" then put "/" after tNewName
--> MAKE FILE / FOLDER NAME
if the hilite of btn "visible" then
if char 1 of tNewName is "." then
delete char 1 of tNewName
end if
else
if char 1 of tNewName is not "." then
put "." before tNewName
end if
end if
delete last item of tNewPath
if last char of tNewPath is "/" then delete last char of tNewPath
put tNewPath & "/" & tNewName into tNewPath
put "mv" && tOldPath && tNewPath into tCommand
get shell(tCommand)
loadFolder fld "theFolder"
end renamePath
on disableProps pBool
if pBool is true then
disable btn "visible"
disable btn "Rename"
disable fld "thePath"
unhilite btn "visible"
put empty into fld "thePath"
else
enable btn "visible"
enable btn "Rename"
enable fld "thePath"
hilite btn "visible"
end if
end disableProps
on loadFolder pFolder
if pFolder is empty then
answer folder "choose a folder" with fld "theFolder"
if it is empty then exit to top
put it into pFolder
end if
put the defaultFolder into tOldDF
set the defaultFolder to pFolder
put shell("pwd") into tDefaultFolder
delete last char of tDefaultFolder
if last char of tDefaultFolder is not "/" then put "/" after tDefaultFolder
put tDefaultFolder into fld "theFolder"
if the hilite of btn "show invisible files" then
put shell("ls -a -p") into tResponse
else
put "./" &cr& "../" &cr& shell("ls -p") into tResponse
end if
if tResponse contains "ls: .: Permission denied" then put "./" &cr& "../" &cr before tResponse
delete last char of tResponse
put tResponse into fld "theFiles"
set the defaultFolder to tOldDF
disableProps true
end loadFolder
on stripAndShip
disableProps true
put "" into fld "theFolder"
put "" into fld "theFiles"
put "" into fld "thePath"
end stripAndShip
Choose gw %on mouseUp loadFolder end mouseUp R N choose folder Choose.. cREVGeneral revUniqueID 1087279749592breakPoints theFiles )p on mouseDoubleUp put line the hilitedlines of me of me into tSelect put fld "theFolder" into tFolder switch case tSelect is "./" loadFolder "/" break case tSelect is "../" set itemDel to "/" delete last item of tFolder loadFolder tFolder break case last char of tSelect is "/" put tFolder & tSelect into tNewFolder loadFolder tNewFolder break end switch disableProps true end mouseDoubleUp on mouseUp put line the hilitedlines of me of me into tSelect put fld "theFolder" into tFolder switch case tSelect is "./" case tSelect is "../" case tSelect contains "ls: .: Permission denied" disableProps true break default put tFolder & tSelect into tNewFolder getPathInfo tNewFolder break end switch end mouseUp on getPathInfo pPath disableProps false put pPath into fld "thePath" set itemDel to "/" put last item of pPath into tName if first char of tName is "." then unhilite btn "visible" else hilite btn "visible" end if end getPathInfo V" A altLayoutManager MacOSXaltCmd SX:-17,SY:-97MacOSXaltRect 20,86,310,151altCmd SX:-17,SY:-97altRect 20,86,310,151 cREVGeneral revUniqueID 1087279804969breakPoints ` % W ? theFolder 3" altLayoutManager MacOSXaltCmd SX:-17MacOSXaltRect 20,51,310,73altCmd SX:-17altRect 20,51,310,73 cREVGeneral revUniqueID 1087283226219 show invisible files `E 5on mouseUp loadFolder fld "theFolder" end mouseUp altLayoutManager MacOSXaltCmd MX:-17MacOSXaltRect 180,8,310,31altCmd MX:-17altRect 180,8,310,31 cREVGeneral revUniqueID 1087283279658 visible `E 'on mouseUp renamePath end mouseUp R altLayoutManager MacOSXaltCmd MY:-13MacOSXaltRect 22,212,104,235altCmd MY:-13altRect 22,212,104,235 cREVGeneral scriptChecksum &8w7quE p bookmarks revUniqueID 1087283698903handlerList mouseUpbreakPoints scriptSelection char 38 to 37prevHandler renamePathtempScript script Pon mouseUp
renamePath
end mouseUp
thePath 9h " altLayoutManager MacOSXaltCmd SX:-17,MY:-43MacOSXaltRect 20,183,310,205altCmd SX:-17,MY:-43altRect 20,183,310,205 cREVGeneral revUniqueID 1087284018920 Rename Ep %on mouseUp renamePath end mouseUp H altLayoutManager MacOSXaltCmd MX:-19,MY:-16MacOSXaltRect 236,214,308,232altCmd MX:-19,MY:-16altRect 236,214,308,232 cREVGeneral scriptChecksum Qmm40kP bookmarks revUniqueID 1087287171967breakPoints handlerList mouseUpscriptSelection char 37 to 36prevHandler mouseUptempScript script @on mouseUp
renamePath
end mouseUp
altLayoutManager MacOSXaltCmd MY:-64MacOSXaltRect 16,163,144,184altCmd MY:-64altRect 16,163,144,184 cREVGeneral revUniqueID 1087287917286 Selected F cREVGeneral revUniqueID 1087287839091 Directory Contents &