• 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: Using Log with Smile
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Log with Smile


  • Subject: Re: Using Log with Smile
  • From: Barry Wainwright <email@hidden>
  • Date: Thu, 22 Jan 2015 15:12:53 +0000

> On 22 Jan 2015, at 14:56, Robert Poland <email@hidden> wrote:
>
> Isn’t there an easier way? buried in 4000 lines would be APITA.
>
>

set logFilePath to ((path to home folder) as text) & "Library:Logs:myScript.log"
try
	set logFile to open for access logFilePath with write permission
on error
	close access logFile
	return -99
end try

tell application "Console" to open (logFilePath as alias)

#
# Your Script
#

write "Log This: " & (current date) & return to logFile

#
# More Script
#

close access (logFile)

--
Barry


 _______________________________________________
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


References: 
 >Using Log with Smile (From: Robert Poland <email@hidden>)
 >Re: Using Log with Smile (From: Deivy Petrescu <email@hidden>)
 >Re: Using Log with Smile (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: Using Log with Smile
  • Next by Date: Outlook in Yosemite?
  • Previous by thread: Re: Using Log with Smile
  • Next by thread: Re: Using Log with Smile
  • Index(es):
    • Date
    • Thread