• 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: Keeping a text-entry in the background, or a work-around
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Keeping a text-entry in the background, or a work-around


  • Subject: Re: Keeping a text-entry in the background, or a work-around
  • From: Jon Pugh <email@hidden>
  • Date: Thu, 29 Nov 2007 16:29:45 -0800

At 10:42 AM -0700 11/29/07, Clint Hoxie wrote:
>I've copied a script from Alvin Alexander and then modified it a bit. It is intended to open some URLs for me on a repeating basis. I have the script saved as an application bundle which is called as an alarm by iCal. My difficulty is that the script requires a keyboard command to enter the URL, which means that I can't be touching the machine when the script runs, or I likely interfere with its successful execution. I looked for a solution online, but don't have enough experience to know what resources I need. Can anyone help?

Open a blank window in front:

 tell application "Safari"
     make new document at end of documents
 end tell


Open a window and load a URL into it:

 tell application "Safari"
     make new document at end of documents with properties {URL:u}
 end tell


I don't mess with tabs.  My "Morning Reading" script opens a stack of windows that I can close as I read them using this handler:

 on showURL(u)
     tell application "Safari"
         make new document at end of documents with properties {URL:u}
         set bounds of window 1 to {1, 22, 1181, 1198}
     end tell
 end showURL


Then I choose what to load based on the day of the week:

 set currentDate to current date
 set currentDay to weekday of currentDate
 set isWinter to month of currentDate is in {October, November, December, January, February, March, April}
 tell application "Safari"
	 close windows	-- I close all windows since I do this manually
 end tell
 -- URLs open in reverse order, some only on specific days
 if isWinter then
	 showURL("http://www.seanet.com/~jonpugh/SkiSummary.html";)
 end if
 showURL("http://antwrp.gsfc.nasa.gov/apod/astropix.html";)
 if currentDay is Wednesday then
	 showURL("http://www.aip.org/physnews/update/";)
 end if
 showURL("http://www.doonesbury.com/strip/dailydose/";)
 showURL("http://www.unitedmedia.com/comics/getfuzzy/";)
 showURL("http://www.unitedmedia.com/comics/dilbert/archive/";)
 if currentDay is Sunday then
	 showURL("http://www.gocomics.com/foxtrot/";)
 end if
 showURL("http://www.gocomics.com/forbetterorforworse/";)
 if currentDay is Monday then
	 showURL("http://www.gocomics.com/tomthedancingbug/";)
 end if
 --showURL("http://www.gocomics.com/boondocks/";)
 showURL("http://www.penny-arcade.com/comic/";)
 showURL("http://www.schlockmercenary.com/";)
 if currentDay ‚ Saturday and currentDay ‚ Sunday then
	 showURL("http://wapsisquare.com/";)
	 showURL("http://www.crazyapplerumors.com/";)
	 showURL("http://www.macfixit.com/";)
	 showURL("http://www.iphoneatlas.com/";)
	showURL("http://www.macintouch.com/";)
	 if currentDay = Tuesday then
		 showURL("http://www.tidbits.com/tb-issues/TidBITS-current.html";)
	 end if
 end if


 _______________________________________________
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

  • Follow-Ups:
    • Re: Keeping a text-entry in the background, or a work-around
      • From: Malcolm Fitzgerald <email@hidden>
    • Re: Keeping a text-entry in the background, or a work-around
      • From: Clint Hoxie <email@hidden>
References: 
 >How do I use UI scripting to click a button in a save dialog in TextEdit in Leopard? (From: Laine Lee <email@hidden>)
 >Keeping a text-entry in the background, or a work-around (From: Clint Hoxie <email@hidden>)

  • Prev by Date: InDesign CS2 Find Scale of Images
  • Next by Date: Re: Keeping a text-entry in the background, or a work-around
  • Previous by thread: Re: Keeping a text-entry in the background, or a work-around
  • Next by thread: Re: Keeping a text-entry in the background, or a work-around
  • Index(es):
    • Date
    • Thread