set tempPath to "MacHD:FileCutList.temp" --path of temp file set exlist to ""
tell application "Finder" set theItemList to selection if theItemList is {} then if exists front window then set exlist to ((target of front window) as alias) as string else display dialog "Nothing to FileCut" with icon 1 return end if else repeat with theObj in theItemList if exlist is "" then set exlist to (theObj as alias) as string else set exlist to exlist & return & (theObj as alias) as string end if end repeat end if end tell
try set fileNum to open for access file tempPath with write permission set eof fileNum to 0 write exlist to fileNum beep end try close access file tempPath
set temppath to "MacHD:FileCutList.temp" --path of temp file
try set tempfile to open for access file temppath set theItemList to read tempfile using delimiter {return} as text on error display dialog "read error" return end try close access tempfile
--display dialog theItemList
tell application "Finder" --set theTarget to target of front window --display dialog (theTarget as alias) as string
-- Youpi Key has bugs --if ((target of front window as alias) as string) does not end with ":" then --display dialog (target of front window as alias) as string --set theTarget to container of target of front window --end if
--move theItemList to folder ((target of front window) as string) repeat with theObj in theItemList --display dialog theObj if exists theObj as alias then if container of (theObj as alias) is target of front window then display dialog "can not" else try duplicate theObj as alias to (target of front window) as alias delete theObj as alias end try end if else display dialog "file not found" & return & theObj with icon 0 end if end repeat end tell