Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

AHK CopyPassage v2.0


  • Please log in to reply
61 replies to this topic
AGermanUser
  • Members
  • 82 posts
  • Last active: Apr 07 2010 06:06 PM
  • Joined: 12 Feb 2005
Hello folks 'n friends :mrgreen:

Take a look at one of my creations. ;) Its name is AHK CopyPassage.

Posted Image

Usage:

Imagine you're surfin the web and discover some lines of text on a website you might need later. So what do you do? Save it to a loose textfile on your desktop and end up with a textfile filled with lots of text passages. Hard to organize.

That's why I wrote this little tool. It contains some usefull hotkeys:[*:313eglah]Win + c (copy)[*:313eglah]Ctrl + Win + c (copy and rename)[*:313eglah]Win + g (gui)[*:313eglah]Win+ a (Google Search)[*:313eglah]Win + s (URL LookUp)Win+c creates a textfile in the scripts subdir 'notes' which hold the date, URL and the copied text passage.
Ctrl+Win+c make the same as mentioned above but asks you to specify an apposite name for the text file and saves it to the defined directory within the script.
Win+g opens a GUI which lets you organize all your little textfiles.
Win+a performs a GoogleSearch on any highlighted text.
Win+s tries to open a highlighted URL within your standard browser. (This hotkey might even work with other filetypes, not judst URLs- test it)

The hotkeys can also be configured within the script to fit your needs.

Attention:
At the moment the script is preconfigured to work with Firefox 1.5 (I think Firefox 1.0.x may work as well). But you can configure you're browser within the script.


Installation:
Just as everytime. Unpack zip file in a directory of your choice and run 'main.ahk'.

Download:
:arrow: AHK CopyPassage 2.0

The Scripts
Of course you may have a look at the scripts.[*:313eglah]main.ahk
[*:313eglah]functions.ahkUpdate:
24.03.2006
+ added ExportDirectory to Preferences GUI (thx afterburner)
+ added Export note to context menu
+ added Edit Menu to Menubar incl. Icons
+ replaced StringSplit with Parse Loop in CallURL subroutine and included an URL check
+ added ExportWithName Hotkey
+ added Google Search Hotkey
+ added URL Lookup Hotkey
26.02.2006
+ added GuiEscape label - Close Gui on Escape (thx dmiranda)
+ added SetTitleMatchMode, 2 to check for Browsername in WinTitle
+ URL is now only copied when WinTitle contains one of the keywords otherwise WinTitle is used
+ added Del-Key Hotkey to easily delete notes from ListView
+ added Up- and DownArrow Key hotkeys for keyboard navigation within ListView
10.02.2006
+ corrected some comments (save buttons deleted from Preferences GUI)
+ added F6 to FF section in BrowserShortscuts GUI
+ added `r (carriage return) to FileAppend command
+ changed link in About GUI to english thread


danpos
  • Members
  • 6 posts
  • Last active: Apr 28 2006 08:43 PM
  • Joined: 07 Feb 2006
Damn, this is a neat piece of software. It'll save my life cos I always need to save text from website which I've visited.

Thank you for yours time and efforts.

See ya,

EDIT: I've found out an issue: if you'are running Micro-Sys Launcher together with CopyPassage, the , signals are sent to it, messing up the CopyPassage application. JFYI. :D

AGU
  • Guests
  • Last active:
  • Joined: --

I've found out an issue: if you'are running Micro-Sys Launcher together with CopyPassage, the , signals are sent to it, messing up the CopyPassage application. JFYI.

thx danpos,

Ctrl+L is a firefox shortcut. I can't influence this shortcut. On the other hand the Win+C shortcut can be easily customized within the script. Just open FILE - Preferences.
In this GUI you can configure another shortcut for the "Copy" action. (See the two hotkey controls in the 2nd groupbox?)

Cheers
AGU

btw. A hort question:
When your Firefox is the active window pressing Ctrl+L interferes with Micro-Sys Launcher? Have you tested that without running AHK CopyPassage?

danpos
  • Members
  • 6 posts
  • Last active: Apr 28 2006 08:43 PM
  • Joined: 07 Feb 2006

btw. A hort question:
When your Firefox is the active window pressing Ctrl+L interferes with Micro-Sys Launcher? Have you tested that without running AHK CopyPassage?


Yep, it does! I'd tested it out without running AHK CopyPassage (and right now I repeated the test and I got the same result).

See ya,

AGU
  • Guests
  • Last active:
  • Joined: --
thx again danpos,

would you be so kind to test if {F6} might work with your Firefox?
Just open File-Preferences click on the radio button beside the FF Logo or on the logo itself and type in {F6} in the edit control which got activated.
Afterwards close the Preferences window and it should work.

Cheers
AGU

danpos
  • Members
  • 6 posts
  • Last active: Apr 28 2006 08:43 PM
  • Joined: 07 Feb 2006
@AGU

I did the test. No more interference with the other app, but the "Open URL" option isn't working properly. I let you see a screen captured with the neat AHK script Easy Copy AHK:

Posted Image

As you can to see, I choose this topic (your message) for to do the test. The URL triggered is

http://www.autohotkey.com/forum/viewtopic.php?t=7914


but the URL launched is

http://www.autohotkey.com/forum/viewtopic.php?t=791


i.e., the last digit was cut out :!:

JFYI. :)

See ya,

Foo
  • Members
  • 37 posts
  • Last active: Nov 23 2011 02:22 AM
  • Joined: 09 Feb 2006
Awesome APP. Kudos!

AGU
  • Guests
  • Last active:
  • Joined: --
@Foo
thx. :D

@danpos

I tried to reproduce the error on my system but without success. Did you eventually edit the textfile via "Edit Note" context menu entry?

Concerning the "Open URL" feature:
The app just takes the textfile and splits it at the linebreaks (`n) with the help of StringSplit. This is the code:
FileRead, note_text, %A_ScriptDir%\notes\%note_file%
  StringSplit, note_array, note_text, `n
  StringTrimLeft, note_array3, note_array3, 5
  StringTrimRight, note_array3, note_array3, 1
  Run, %note_array3%
In this way the URL is stored in note_array3. I think you probably edited the textfile and put a linebreak before the last digit. This is the only way I could explain this error.
I tried it with the exact text passage as your example and it worked fine.

Cheers
AGU

danpos
  • Members
  • 6 posts
  • Last active: Apr 28 2006 08:43 PM
  • Joined: 07 Feb 2006
@AGU

I did more tests. See two notes about two distincts URLs:

Date: 09.02.2006 21:51:09

URL: http://news.bbc.co.u...cas/4697896.stm

The president said the alleged mastermind of the 11 September 2001 attacks, Khalid Sheikh Mohammed, was behind the west coast plot.


It appears in this exact way into Notepad. The lines are in fact splited, each one sticking in your line itself.

Whereas the other test with same piece of your post at this board:

Posted Image

You can see that the lines weren't splited into Notepad and perhaps explains the fault here (I just saw that putting a blank space at end - I mean after digit "4" - does a trick).

I'm gone ahead with tests and tested this link at a board powered by SMF out and it doesn't work with this forum engine. The same is applied for foruns powered by VBulletin engine.

JFYI. :)

PS: As you can to see, my great interest in your neat tool is catalog links related to text caught into forum posts.

AGU
  • Guests
  • Last active:
  • Joined: --
OK, I see the problem. :)

It looks to me like a CR+LF (Carriage Return and Linefeed) issue I faced some times ago. Windows saves linebreaks with CR+LF (AHK: `r`n) whereas I append the text to file with a normal linefeed (`n). Maybe this is the error.

I replaced
FileAppend, Date:`t%note_date%`n`nURL:`t%note_url%`n`n%note%
  , %A_ScriptDir%\notes\%note_filename%.txt
with
FileAppend, Date:`t%note_date%`r`n`r`nURL:`t%note_url%`r`n`r`n%note%
  , %A_ScriptDir%\notes\%note_filename%.txt
and it doesn't make a differnce in the text file. So I will release another version with the corrected code soon. Let's see if that helps. :)

btw. the forum engine shouldn't make a difference. On my system it works with vb engine.

In short words how the APP works:
[*:azf90wyp]Copies the highlighted text within your browser to clipboard and save clipboard content to a variable
[*:azf90wyp]Send browsershortcut to focus addressbar and copy URL to clipboard and afterwards to a variable
[*:azf90wyp]Take current system time (A_Now AHK variable) and the two variables and append all of them to a textfile.You see, the content displayed within the browser shouldn't make any difference. All that has to work is your clipboard, the system shortcut +C and the shortcut within your browser to focus the address bar.

Cheers
AGU

AGermanUser
  • Members
  • 82 posts
  • Last active: Apr 07 2010 06:06 PM
  • Joined: 12 Feb 2005
OK, small update made. See first posting. :)

danpos
  • Members
  • 6 posts
  • Last active: Apr 28 2006 08:43 PM
  • Joined: 07 Feb 2006
@AGU

Great update :!: Now everything is working like a charm :!: :D

Thank you so much for your assistance and forgive me for any inconvenience, but I think that a user should to test everything out hardly.

I do confirm: now everything goes well. :D

Best Regards,

AGU
  • Guests
  • Last active:
  • Joined: --

forgive me for any inconvenience

Not at all. I must say thank you for hard testing my little app. :) In this way I was able to fix some errors. And that's always the way it should work.

Therefore I'm really thankful for users like you, who report errors, feedbacks, suggestions, enhancements, ...
They help me to improve my Apps.

Cheers
AGU a.k.a AGermanUser

danpos
  • Members
  • 6 posts
  • Last active: Apr 28 2006 08:43 PM
  • Joined: 07 Feb 2006

Therefore I'm really thankful for users like you, who report errors, feedbacks, suggestions, enhancements, ...


Your welcome :!: :D

Regards,

afterburner
  • Members
  • 52 posts
  • Last active: Oct 26 2006 07:11 AM
  • Joined: 23 Jul 2005
I unziped the program into a folder on my desktop and ran it. It gave me the following error. What should I do?

Posted Image