• 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: Make New File in System Events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make New File in System Events


  • Subject: Re: Make New File in System Events
  • From: Matthew Smith <email@hidden>
  • Date: Mon, 17 Oct 2005 11:30:18 +1000
  • Thread-topic: Make New File in System Events

On 17/10/2005 11:15, "Luther Fuller" <email@hidden> wrote:

> I can write this code ...
>
>      tell application "Finder"
>          if not (exists file fileName of locRef) then
>              make new file at locRef with properties {name:fileName}
>
> and get exactly what I want without error.
> But when I try this code ...
>
>      tell application "System Events"
>          make new file at locRef with properties {name:fileName}
>
> I always get: Error = 6, NSArgumentsWrongScriptError
>
> 'locRef' is an alias, but in the second snippet, I've tried posix path also,
> but same results.
>
> Does anyone know what's going on here?

Not sure exactly why but the following will work:

set desktopalias to path to desktop
tell application "System Events"
    make new file at end of files of desktopalias with properties
{name:"ASD"}
end tell

--
Matthew Smith


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Make New File in System Events (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Days and hours
  • Next by Date: Re: Is Classic running?
  • Previous by thread: Make New File in System Events
  • Next by thread: Re: Make New File in System Events
  • Index(es):
    • Date
    • Thread