Dynamically automate my appointment calendar in IE with today's date in the link?
January 28, 2009 1:57 PM   Subscribe

Help me create a short cut that opens an Internet Explorer webpage with part of the link set to change dynamically to today's date (i.e., http://boingboing.net/2009/01/27/ if I clicked on it yesterday, http://boingboing.net/2009/01/28/ if I clicked on it today). Can this be done?

My office lets me see a calendar of appointments with clients through a web-page which accesses information from our intranet. It only opens via Internet Explorer. Part of the link includes the date of those appointments:
=Date(2009,1,7)

Currently, I simply created a shortcut to a given date (above) and manually change it then go to the new date as entered (i.e., =Date(2009,1,28)).

I would like to be able to have a shortcut which dynamically updates the date to "today" ... so I can click on the shortcut and be directed to a page with today's appointments rather than manually altering the date in the link each time.

Any ideas short of Autohotkey?

Thanks a million!
posted by unclezeb to Computers & Internet (10 answers total) 2 users marked this as a favorite
 
You could do the rather easily with a .vbs file. I'm about to leave for class, so I don't have time to piece anything together, but that should point you in the right direction. This site will have a lot of help in that regard.

One other idea is a javascript/PHP/some-other-technology redirect based on the current date.
posted by niles at 2:06 PM on January 28, 2009


Very primitive -- put this in your bookmark bar. Adjust to your URL.

javascript:d=new%20Date();window.open('http://google.com/search?q='+d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate(),'date');


Left as an exercise for the reader is to insert leading zeros on month and day if you need them.
posted by devbrain at 2:27 PM on January 28, 2009




javascript:d=new%20Date();window.open('http://boingboing.net/'+d.getFullYear()+'/'+(d.getMonth()<9>


posted by devbrain at 2:43 PM on January 28, 2009


Obviously the preview page lied to me.

javascript:d=new%20Date();window.open('http://boingboing.net/'+d.getFullYear()+'/'+(d.getMonth()<9?'0':'')+(d.getMonth()+1)+'/'+(d.getDate()<10?'0':'')+d.getDate(),'date');
posted by devbrain at 2:45 PM on January 28, 2009


Response by poster: Great, but I'm not quite there yet in terms of getting the syntax of the address correct:

The address is:
http://[...blah...]prompt0=Date(2009,1,7)[...blah...]

Therefore, shouldn't the script read:

javascript:d=new%20Date();window.open('WEBSITE SYNTAX UP TO prompt0=Date('+d.getFullYear()+','+(d.getMonth()<9>ADDITIONAL SYNTAX');

Thus,
Year,month,day =
('+d.getFullYear()+','+(d.getMonth()<9>
BUT I cannot make that work, any other thoughts on how to format this or for an alternative method?
posted by unclezeb at 3:55 PM on January 28, 2009


added to devbrain's post
:


javascript:d=new%20Date();window.open('http://boingboing.net/'+d.getFullYear()+'/'+(d.getMonth()<9?'0':'')+(d.getMonth()+1)+'/'+(d.getDate()<10?'0':'')+d.getDate()+'additionalstuff','date');
posted by bbyboi at 4:27 PM on January 28, 2009


Best answer: I was using the boingboing example which needs leading zeros. If you're putting a literal Date(Y,M,D) in the URL then you won't need them I'm sure.

You should probably switch the window.open for a location= to be tidy. I bumped into a few syntax errors while writing that little bookmarklet. Test it in firefox, open the error console, and it'll tell you what's wrong. Might be something simple like needing to url escape the parens, or having a mismatched paren in the code.

-- this works for me (only have firefox here to test with though) --


javascript:d=new%20Date();location='http://google.com/search?q=Date('+d.getFullYear()+','+(d.getMonth()+1)+','+d.getDate()+')&otherargs=here';

posted by devbrain at 6:26 AM on January 29, 2009


Response by poster: That's it Devbrain!

Only one more issue:
When I drag that script into the "link" bar on IE and click it, everything works perfectly.
However,
I'd like to use this is a short cut from my desktop. But when I drag the "link" to my desktop (creating a short cut) then double click it, IE opens and quickly closes new IE window.

How can I make that window open and stay open from a desktop short cut (rather than opening IE then clicking the link I've created on the link bar)?
posted by unclezeb at 11:58 AM on January 30, 2009


Regarding the desktop, create a simple HTML page with just that javascript as aon onload= function and you're golden.


<html>
<title>Redirector</title>
<script type="text/javascript">
function load() {
d=new Date();
location='http://google.com/search?q=Date('+d.getFullYear()+','+(d.getMonth()+1)+','+d.getDate()+')&otherargs=here';
}
</script>
<body onload="load()">
... redirecting
</body>
</html>



p.s. you now owe me a cookie.
posted by devbrain at 3:04 PM on January 30, 2009


Response by poster: That works great (created the html file in notepad with .html extension).

I had one other issue which I resolved:

When I opened html the file, it opened IE but took me to a page with a warning about activex:
"To help protect your security, Internet Explorer has restricted this file from showing active content that could access your computer. Click here for options..."

I had to go to: Internet Options > advanced tab > scroll down to security and put
a check in 'Allow Acitive content to run in files on My Computer'

Now it works like a charm! Thanks a million Devbrain!
posted by unclezeb at 3:49 PM on January 30, 2009


« Older Best way to promote a nonfiction book?   |   Legit Foreclosure Listings? Newer »
This thread is closed to new comments.