• 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: Safari Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Safari Question


  • Subject: Re: Safari Question
  • From: Rob Jorgensen <email@hidden>
  • Date: Mon, 14 Jul 2003 00:12:08 -0400

On Friday, July 11, 2003, at 06:04 AM, William Miller wrote:

is it possible to script safari to launch at startup and go to a specific url if it has not been active for a specific amount of time?

I am very new to apple script...any help would be great...thanks

At 10:14 PM +0930 7/13/03, Nathan Day wrote:
You could save a script as an applet and add it to the login items thru System Preferences. Getting Safari to go to load a page thru applescripts is easy enough

tell application "Safari"
activate
set URL of document 1 to "http://www.apple.com/";
end tell

to check if when it was last active, I don't think this is possible unless you can do something with javascripts. You should be able to keep track of when your AppleScript was last run by setting the a property of your script with the current time, properties are maintained between execution of your script, though I am not sure how to get the current date. You could you use do 'do shell script ' and the terminal command 'time' but trying to compare times like this would be difficult, it would be easier if there is a pure AppleScript way of getting the current date since you can compare 'date' data types.

Using an idle handler, maybe the script could check the Safari history file's modification date to see if it has changed since the last check. If the date has changed, Safari is in use.

--

Rob Jorgensen
Ohio, USA
_______________________________________________
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: Safari Question
      • From: Joshua See <email@hidden>
References: 
 >Re: Safari Question (From: Nathan Day <email@hidden>)

  • Prev by Date: [ANN] Track Timer Plus for iTunes
  • Next by Date: Re: Need Type Command for OS X
  • Previous by thread: Re: Safari Question
  • Next by thread: Re: Safari Question
  • Index(es):
    • Date
    • Thread