| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| Hi Tim, The script below would allow you to enter the address manually, but I don't think I have got what you are trying to achieve. If the purpose is to open a given address at a set date, then just set the property to the given address as in the previous example. If you are trying to automatically set different addresses, then your script suddenly becomes more than a beginner would be expected to achieve. The script here allows the user to enter an address, but I don't think that that is what you want: property target_URL : "www.apple.com" set target_URL to the text returned of (display dialog "Enter the requested URL" default answer "http://www.apple.com") tell application "Safari" open location target_URL end tell This next script allows you to set options based on dates and this may be more like what you may wish: This has a range of dates that opens different web sites based on the date that your script is called. By setting third, fourth , fifth dates etc., your script will automatically go to the right web page based on the date iCal opens the script. If the script is run on a date not in the list, then it will ask you for an address. set myFirstDate to "2007-06-11" set myFirstAddress to "http://www.apple.com" set mySecondDate to "2007-06-12" set mySecondAddress to "http://www.store.apple.com" set TodaysDate to do shell script "date +%Y-%m-%d" if TodaysDate is myFirstDate then set target_URL to myFirstAddress --> Sets the first address as the chosen site else if TodaysDate is mySecondDate then set target_URL to mySecondAddress --> Sets the second address as the chosen site end if end if tell application "Safari" try open location target_URL --> Goes to the Web page chosen on error --> If the dates do not match the current date set target_URL to the text returned of (display dialog "Enter the requested URL" default answer "http://www.apple.com") --> Asks for you to choose a web page end try end tell --> On 11/06/2007, at 5:37 AM, Tim Whiteknight wrote: Ok I did what you said but took out the URL to the store. Something like this. Got errors instead. Peter Baxter Music creates order out of chaos: for rhythm imposes unanimity upon the divergent, melody imposes continuity upon the disjointed, and harmony imposes compatibility upon the incongruous. -- Yehudi Menuhin iChat email@hidden |
_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden Archives: http://lists.apple.com/archives/applescript-users This email sent to email@hidden
| References: | |
| >iCal alarm opening URL with script. HOW? (From: Tim Whiteknight <email@hidden>) | |
| >Re: iCal alarm opening URL with script. HOW? (From: Peter Baxter <email@hidden>) | |
| >Re: iCal alarm opening URL with script. HOW? (From: Tim Whiteknight <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.