• 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
Newbie Q on self-executing log app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newbie Q on self-executing log app


  • Subject: Newbie Q on self-executing log app
  • From: email@hidden
  • Date: Wed, 26 Mar 2003 19:51:54 EST

I'm trying to set up a self-executing app to log the times of the day that a
computer is both turned on and off, which I had figured on placing aliases of
in the Startup Items and Shutdown Items folders (OS 8.6). To that end the
following was written:

tell application "Finder"
get (current date)
copy (result as string) to the clipboard
tell application "Scriptable Text Editor"
activate
open document "Macintosh HD:TemporaryStuff:untitled"
paste contents of clipboard
set (return) to last character of text
close document "untitled" saving yes
quit
end tell
end tell

However, apparently there's a bit of trouble coercing the current date to a
string, as the command "copy (result as string) to the clipboard" results in
the following error message:

--> Can't set the clipboard of "Wednesday, March 26, 2003 9:25:39 AM" to
B+scriptB;.

Is this not possible? Or do I need a subroutine to do this? Or, worse yet, am
I missing something obvious? If so how must one go about this and why?

Also could you offer pointers on how to make this self-executing; that is,
without that dialog box with the "Run" radio button.

TIA for your help.

Mike
email@hidden
**************************************************
"The work of the individual still remains the spark
that moves mankind forward." bIgor Sikorsky
_______________________________________________
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: Newbie Q on self-executing log app
      • From: Mr Tea <email@hidden>
    • Re: Newbie Q on self-executing log app
      • From: Andrew Oliver <email@hidden>
  • Prev by Date: Re: Script to Copy/Paste Entourage Message Bodies
  • Next by Date: Re: Selecting files in a list
  • Previous by thread: GUI scripting hiccup
  • Next by thread: Re: Newbie Q on self-executing log app
  • Index(es):
    • Date
    • Thread