Re: What should be a simple question, I think about creating a file....
Re: What should be a simple question, I think about creating a file....
- Subject: Re: What should be a simple question, I think about creating a file....
- From: Doug McNutt <email@hidden>
- Date: Tue, 6 Apr 2010 13:01:57 -0600
At 11:26 -0700 4/6/10, Michelle Steiner wrote:
On Apr 6, 2010, at 10:58 AM, OSullivan, Steven wrote:
to CreateFixFile(versionStr, mailBody)
set myFileName to ("Fix List for " & versionStr & ".htm") as string
tell application "Finder" to set myFile to ((path to desktop as string) & myFileName) as alias
write mailBody as string to myFile
close access
end CreateFixFile
Here you go:
to CreateFixFile(versionStr, mailBody)
set myFileName to ("Fix List for " & versionStr & ".htm")
set myFile to (open for access (path to desktop as string) & myFileName with write permission)
write mailBody as string to myFile
close access myFile
end CreateFixFile
The lesson to be learned for next time is that Finder doesn't know how to create an alias to a file that does not - yet - exist. (It also doesn't have a "touch" command or redirection of stdout if you're coming from where I think your are.)
The next thing to note is that the write command doesn't require an alias for an argument. I donno if your original would work if the file already exists.
--
Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden