Re: Need help, please: duplicate file name
Re: Need help, please: duplicate file name
- Subject: Re: Need help, please: duplicate file name
- From: Andy Wylie <email@hidden>
- Date: Sat, 23 Mar 2002 22:22:10 +1200
on 23/3/02 9:13 PM, Jan Erik Mostrvm at email@hidden wrote:
>
Since moving to OS X I have some serious problems with "open for access", I'm
>
probabably making some simple mistake but I can't figure out what. I
>
typically do
>
>
set fr to open for access (file theFile) without write permission
>
>
and get a "Duplicate file name" error message when I try to run the script
>
... but why. Here is an example
>
>
on prepareMeshfile(rootName)
>
tell application "Finder"
>
set theFile to destDirectory & rootName & ".temp"
>
if file theFile exists then
>
set fr to open for access (file theFile) without write permission
>
set tmp to read fr
>
close access fr
>
set mf to open for access file (destDirectory & rootName &
>
".mesh") with write permission
>
write tmp to mf
>
return mf
>
else
>
display dialog "Oppps, kunde inte hitta " & theFile
>
end if
>
end tell
>
end prepareMeshfile
>
>
When I come to the first open for access then I get the error message (I've
>
tried without 'file' and with 'alias' but the result is the same).
>
>
What am I missing?
>
>
on 20/3/02 9:38 AM, Christopher Nebel at email@hidden wrote:
>
>
> Using Finder object specifiers with scripting
>
> addition calls like this is a little-known and undocumented but
>
> often-used feature. (Typically, it's used somewhat accidentally by
>
> newbies like yourself -- more experienced folk "know" it shouldn't work
>
> and don't try it. I should point out that it doesn't work on Mac OS X
>
> yet because of a problem in the Finder itself.)
So the solution should be to move the Standard Additions read/write commands
out of the Finder tell.
_____________________________ Andy
_______________________________________________
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.