• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Need help, please: duplicate file name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Need help, please: duplicate file name
      • From: Jan Erik Moström <email@hidden>
  • Prev by Date: Need help, please: duplicate file name
  • Next by Date: Finding folder from its id
  • Previous by thread: Need help, please: duplicate file name
  • Next by thread: Re: Need help, please: duplicate file name
  • Index(es):
    • Date
    • Thread