Did you ever figure out how to do this? I'm assuming you did, as there are multiple methods for performing that very useful concept.
1) On the event of the website being completely loaded, you can register the pressing of the TAB key to cycle to the input URL box. This works on a Mac, in Safari, but I'm not sure about this on Windows or another web browser. I definitely recommend you give this method a try, as it is much more simple than the next two.
2) Take a screenshot of the input field for the URL and then use the command 'ImageSearch' to find it and click on the returned value of the coordinates. I'm not sure if this will work, but it should if you read the documentation. I also recommend Sikuli for graphical automation as it looks nice, is deployable to multiple platforms through Java, and greatly simplifies method 2.
3) Find the coordinates of a spot anywhere inside the input field and then tell the script to click there. I don't recommend this, as it might not work if the layout of your browser gets changed or if the website changes even the slightest bit.
Note that all of these methods require updating if the website itself changes.
I encourage people to post other methods that are plausible in this situation. In addition, I'd like to mention for all Mac users that Applescript can be used quite nicely for this by utilizing one of the above methods. If anyone wants, I can probably make the utility for everyone (open source). Finally, please correct me if I made a mistake, or if one my methods is impossible/too difficult/unnecessary/etc.
EDIT v2: tiny.cc does not support web links without the 'http://'. It would be nice to append the http to the beginning of the link (and using the same process, append a www). First you can check the string for the 'http://' by utilizing the 'InStr' method. It would look like the code below. If you want, the CaseSensitive parameter might be nice, as the InStr function will look only for the exact 'http://'. In addition, the variable URL should equal the clipboard content.
Code:
if InStr(URL, "http://")
Then, you'd need to add the 'http://' if the URL does not have it (this would be part of the 'else' conditional). The code below should do the trick.
Code:
newURL := "http://" . URL
You can use the above process to append a 'www.' also, probably by adding some more conditionals (you'll need to check for the 'http://', check for the 'www.', and then check if there is neither). After all this, you'll get a perfect URL to shorten. After you find the form using one of the methods in the original post and then paste the fixed URL in form, you can get the shortened URL by registering the following keystrokes:
Code:
1. RETURN (tell tiny.cc to process the URL)
2. TAB (skip down a form)
3. TAB (skip down to the form with the URL)
4. Ctrl + C (copy the URL that tiny.cc was kind enough to highlight for you)
Then you can close the window and paste the shortened URL.
Note: I do not actually know AHK, instead using Applescript (Mac), but I read some of the documentation and figured out the above process. However, I'm not sure if the code will actually work.
If you want to integrate a URL shortener into a program or make the process 'behind-the-scenes', check out the very nice bit.ly API. I'm not aware if tiny.cc has a public API. You can integrate the API into multiple languages. I recommend this Applescript tutorial as it adds the URL shortener as a service (menu item).