• 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: Creating a log file.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating a log file.


  • Subject: Re: Creating a log file.
  • From: Johnny AppleScript <email@hidden>
  • Date: Wed, 20 Oct 2004 12:47:20 -0600

Title: Re: Creating a log file.
set logPath to "/path/to/logfolder/logfile.log" -- UNIX path form
set logMessage to "my log message"
my logToFile(logMessage)

on logToFile(logMessage)
    
set quotes to "\""  -- protect strings with spaces or special characters
   do shell script "echo " & quotes & logMessage & quotes & " >> " & quotes & logPath & quotes
end logToFile

On 04/10/20 12:28 PM, "Vic Piercy" <email@hidden> wrote:

> I am trying to create a log file from Applescript. I would like to save
> the log file to a specific location. I have been able to create a log
> file from an existing file that is on my desktop by using open for
> access (path to desktop) "Log.txt", but I would like to create a new
> log file and save it to a different folder with a different name
> without having to open a file. Can anyone help? Thank you in advance!!
 _______________________________________________
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: 
 >Creating a log file. (From: Vic Piercy <email@hidden>)

  • Prev by Date: Creating a log file.
  • Next by Date: Re: Creating a log file.
  • Previous by thread: Creating a log file.
  • Next by thread: Re: Creating a log file.
  • Index(es):
    • Date
    • Thread