AutoHotkey Community

It is currently May 27th, 2012, 4:02 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: January 20th, 2006, 4:31 pm 
Offline

Joined: October 1st, 2005, 11:26 pm
Posts: 43
Location: Finland
Dear fellow scripters. Some two months ago I reported my findings on a method to retrieve the URL in Firefox for use in scripts (http://www.autohotkey.com/forum/viewtopic.php?t=6324&highlight=url+firefox). This was by means of the extension "URL2Title". I recently upgraded to Firefox V1.5 and to my dismay found out that this extension was not compatible with the new version and that the author stopped development of this extension.



After a search on the mozilla site however I found an alternative extension, "Copy URL+" (https://addons.mozilla.org/extensions/moreinfo.php?id=129&application=firefox) which also offers a method to retrieve the URL from the active page, albeit in a different way. This extension adds the option to retrieve the title and URL of the active page to the clipboard to the context menu (a.k.a. the menu invoked when right clicking). To incorporate this into your script add the line
Code:
Send, {APPSKEY}ut

and have your script examine the contents of the clipboard.

Admittedly, it is still not a very clean method (as it involves the context menu flashing onscreen everytime it is used) but it's the best I could find so far. One advantage over the other extension (URL2Title) is that the latter only showed the URL in the title bar when the page was finished loading. This extension doesn't have that delay as the URL can be retrieved while the page is still loading.

Hope this is of help for anyone who ran into problems after upgrading to a newer version of Firefox.

_________________
For the music lover who can sit and enjoy the sound of someone else's evolving nightmare.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 20th, 2006, 10:54 pm 
My dirty method:
Code:
F7:: 
Splashimage,,b w180 h33 x633 Y322 cwAQUA m9 b fs18 zh0, Wait Please...
   clipboard =
winactivate,
SEND, ^c
Sleep, 999
   bak = %clipboard%
Sleep, 366
send, ^l ; URL FIREFOX
Sleep, 99
   Send, ^c
Sleep, 999
   clipboard = %bak%`r`n%clipboard%
Sleep, 999
replacementchar = _
tempclip = %clipboard%
tempfilename =
Loop, parse, tempclip, %a_space%
{
   tempfilename = %tempfilename%%a_space%%a_loopfield%
   IfEqual, a_index, 10, Break
}
stringreplace, tempfilename, tempfilename, \, %replacementchar%, 1
stringreplace, tempfilename, tempfilename, /, %replacementchar%, 1
stringreplace, tempfilename, tempfilename, :, %replacementchar%, 1
stringreplace, tempfilename, tempfilename, *, %replacementchar%, 1
stringreplace, tempfilename, tempfilename, ?, %replacementchar%, 1
stringreplace, tempfilename, tempfilename, ", %replacementchar%, 1
stringreplace, tempfilename, tempfilename, <, %replacementchar%, 1
stringreplace, tempfilename, tempfilename, >, %replacementchar%, 1
stringreplace, tempfilename, tempfilename, |, %replacementchar%, 1
stringreplace, tempfilename, tempfilename, `r`n, %a_space%, 1
FileAppend, %a_yyyy%/%a_mm%/%a_dd%___%a_hour%:%a_min%   `r %tempclip%, E:\3\1\%tempfilename%.txt
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 count = 10000
Loop
{
  IfExist,E:\3\1\%count%.txt
    count++
  Else
    break
}
FileAppend, %a_yyyy%/%a_mm%/%a_dd%___%a_hour%:%a_min%---%Clipboard%, E:\3\1\%count%.txt
count++
Splashimage,,b w1000 h633 x13 Y22 cwsilver m9 b fs9 zh0,  %clipboard%
Sleep, 999
Splashimage,,b w480 h33 x233 Y322 cwAQUA m9 b fs18 zh0,    F I L E S   I N   F : 3 \ 1 \ . .
Sleep, 266
SplashImage, Off
Return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 24th, 2006, 6:59 pm 
here a nice script from AGU (retrieve also URL )
http://s89775182.onlinehome.us/forum/vi ... 40&start=0


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 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