• 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: Malcolm Fitzgerald <email@hidden>
  • Date: Fri, 30 Nov 2007 10:07:04 +1100


On 30/11/2007, at 4:42 AM, Clint Hoxie wrote:

I'm new on the list, so I apologize if this post doesn't match usual etiquette.

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 think that the most recent Safari allows you to create new tabs via applescript. I don't have it to try. This works for older versions:



set urlList to {"http://dogpile.com";, "http://www.littlegolem.net/"} -- urls require "http://";
tell application "Safari" to activate
repeat with i from 1 to (count urlList)
tell application "System Events"
-- for each additional url, first create a tab
tell process "Safari"
click menu item "New Tab" of menu "File" of menu bar 1
end tell
end tell
tell application "Safari"
set URL of document 1 to (item i of urlList) -- top tab is always document 1
end tell
end repeat



malcolm

_______________________________________________
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: 
 >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: Re: Idea for better handling of mailinglists
  • 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