Re: Finder not counting files right
Re: Finder not counting files right
- Subject: Re: Finder not counting files right
- From: John McAdams <email@hidden>
- Date: Sat, 27 Apr 2002 16:40:12 -0400
I was using a reference, however the error would occur before I
attempted to work on the file. I'll coerce to alias, perhaps that will
be more stable. This is to clean up after a FMP recover script.
tell application "Finder"
open dbFold
set current view of window "GRL_InvSystem" to list view
close window "GRL_InvSystem"
set dbFiles to every file of folder dbFold whose (name
contains "Recovered")
set fCnt to (count of dbFiles)
repeat with x in dbFiles
set x to x as alias--Mr Tea's suggestion
set dbName to name of x
set AppleScript's text item delimiters to the " Recovered"
set reName to every text item of the dbName
set AppleScript's text item delimiters to ""
set reName to reName as string
--check for proper extension
if dbName ends with ".fp5" and reName does not end with
".fp5" then set reName to [nbsp] reName & ".fp5" as string
set dme to (dbFold & reName) as alias
if reName is not "Recover_everything.fp5" then
delete dme
delay 0.5
set the name of x to reName
end if
end repeat
empty trash
end tell
On Saturday, April 27, 2002, at 11:20 , applescript-users-
email@hidden wrote:
Is your x a file reference or an alias? If it's a file reference (ie
file
"File" of folder "Folder" etc), the referent no longer exists once its
name
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.