AutoHotkey Community

It is currently May 27th, 2012, 12:04 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: August 22nd, 2004, 4:35 pm 
Offline

Joined: July 13th, 2004, 8:25 pm
Posts: 10
Does anyone know how to run a Bookmarklet using AutoHotkey?

A Bookmarklet is a Javascript app that is contained in a Bookmark.

I am using IE 6.0.

If I try to run the Bookmarklet directly using the Run command, it opens it in a new Browser Window, rather than applying the Javascript commands to the currently open Web Page.

Thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2004, 4:38 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
If you look up it's file association in the registry in classes-root, it should tell you what the default verb (action) is. Once you discover that, hopefully you can use whatever that verb does in your script (perhaps by running the associated EXE and passing the bookmark thing as a parameter).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2004, 5:14 pm 
In case anyone doesn't know: What Is A Bookmarklet?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2004, 5:22 pm 
The following code is connected to the Page Freshness Bookmarklet/link, taken from the above mentioned page

Code:
javascript:if(frames.length<1){alert('The server indicates that the page was last modified: ' + window.document.lastModified)}else{alert('Page is framed. Use version of bookmarklet for frames. (bookmarklets.com)')}


if added to the browsers address field and executed it will popup a message box with some usefull information (have a try)

So it should be possible to run IE with the Bookmarklets code as the address parameter/URL, isn't it ?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2004, 5:26 pm 
Quote:
rather than applying the Javascript commands to the currently open Web Page.


Send the Bookmarklet to the address field/Control and press F5 (aka page refresh) should work (?) ...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2004, 8:30 pm 
I had a try with a Bookmarklet from www.sam-i-am.com a webpage owned by Sam Foster.

Quote:
Zoom In, Zoom Out
compatible: IE 5.5, Win32

This pair will zoom in/out the current page in 50% increments. Great for pixel level debugging and using with Element Ancestry to click on exactly the element/screen are you are interested in.

The scripts add/modify a style attribute to acheive the zooming. Thanks to Adrian Cotter for his improvements and doing the zoom out.


Included in an AHK script: F1 = Zoom In / F6 = Zoom Out

Code:
F6::
BM = javascript:void(s=document.body.style);void(z=s.getAttribute('zoom'));if(z){s.setAttribute('zoom'`,(parseInt(z)-50)+'`%');}else s.setAttribute('zoom'`,'50`%');
Goto, ScaleIt

F1::
BM = javascript:void(s=document.body.style);void(z=s.getAttribute('zoom'));if(z){s.setAttribute('zoom'`,(parseInt(z)+50)+'`%');}else s.setAttribute('zoom'`,'150`%');

ScaleIt:
WinActivate, Google-Suche
ControlFocus, Edit2, Microsoft Internet Explorer
ControlSetText, Edit2, %BM%, Microsoft Internet Explorer
Send, {ENTER}
Return


Worked fine. :)


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, Google Feedfetcher, Klark92, Yahoo [Bot] and 19 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group