Re: file rename occasionally fails last time through loop
Re: file rename occasionally fails last time through loop
- Subject: Re: file rename occasionally fails last time through loop
- From: Seth Tager <email@hidden>
- Date: Wed, 7 May 2003 10:11:57 -0700 (PDT)
I assume I apply update to the specific file I'm
trying to rename. I modifed the script to this:
...
tell application "Finder"
set oldfilename to
"path:to:generated:Untitled.html"
update oldfilename
set the name of file oldfilename
to
"newname.html"
end if
end tell
...
It may have solved the rename file failure (didn't
happen the 10 or so times I tried), but now there's
another odd bug which is that the final rename command
sometimes (1 out of 9?) will create a file called
newfile.html, but that file will be empty, while the
orginal file, Untitled.html, will still exist and will
contain the expected contents. It's like it gets half
way through the rename and stops for some unreported
reason.
In the ScriptEditor event log it reports the rename,
and then claims that the original doesn't exist, even
though it's still there:
set name of file "path:to:generated:Untitled.html" to
"newname.html"
"newname.html"
exists "path:to:generated:Untitled.html"
false
Any clue?
BTW, is there reference doumentation for the MacOS
scripting commands? Oddly, I found references to
AS_Finder_Guide.pdf using Google, but that resource
seems non-existent.
Thanks much.
Seth
--- Emmanuel <email@hidden> wrote:
>
At 1:59 PM -0700 06/05/03, Seth Tager wrote:
>
>I've written a script that generates and then
>
renames
>
>multiple files in a loop (generate via FileMaker,
>
>rename via Finder). Sometimes, on the last time
>
>through the loop, the rename command will fail
>
telling
>
>me only that the finder can't rename that file.
>
(The
>
>file definitely doesn't exist before running the
>
>script) Any suggestion about fixing this
>
>
Did you try to apply Finder's "update" command
>
before the critical line?
>
>
Emmanuel
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
_______________________________________________
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.