AutoHotkey Community

It is currently May 27th, 2012, 7:10 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 61 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Praise and a plea
PostPosted: March 10th, 2006, 5:56 pm 
Offline

Joined: July 23rd, 2005, 2:13 am
Posts: 52
I want to thank you guys again for creating this awesome script. I wanted to create something just like this 3 years ago for a school project. Sadly I abandoned the idea because I had limited knowledge of programming and secondly the programming language I was learning was Visual Basic. My instructor directed my partners to pursue something easier. That history aside, here is my plea.

I attempted to improve your awesome scipt by adding the following code:
Code:
;Google Search
!G::
tmp = %clipboard%
Send, ^c
ClipWait, 2
word = %clipboard%
clipboard = %tmp%
run "C:\Program Files\Internet Explorer\iexplore.exe" www.google.com/search?q=%word%
return

;Web Address Lookup
!W::
tmp = %clipboard%
Send, ^c
ClipWait, 2
word = %clipboard%
clipboard = %tmp%
run "C:\Program Files\Internet Explorer\iexplore.exe" %word%
return


The code works well as a stand alone script in Window IE (which is what I use) but when I added it into your script it only worked once. Then it seemed to interfere with your script (it would not copy a passage) I am still a huge novice I think it failed because I did not know exactly where to insert it. Regardless the exact reason for the failure I would love to just have one program to do what yours does and what the code I added does. May I call upon your expertise.

The code I added does the following:

1. By using Alt + G it will copy highlighted text, open a new window and search the target text in Google.

2. By using Alt + W it will copy highlighted text (which is usually a web address in my case) and open a new window and go to that webpage.

I did not know where to add the code into your program to make it work I'm sure you would know much more easily where to add it or if it needs to be rewritten then inserted into the correct place.

These tasks I do a lot. There is probably a shorter better written code to do what I wrote so feel free to point that out too.

Thanks in advance.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 12th, 2006, 3:22 pm 
Hello afterburner,

two points to clarify before going on:
  1. Why do you use the "tmp" variable to backup the content of the clipboard? Do you really need to back it up?
    And if you need to back it up then I think using ClipBoardAll might be the better choice in case s.th else than text has been saved to clipboard before.
  2. Quote:
    1. By using Alt + G it will copy highlighted text, open a new window and search the target text in Google.

    2. By using Alt + W it will copy highlighted text (which is usually a web address in my case) and open a new window and go to that webpage.
    What highlighted text are you talking about. Do you mean highlighted text within the CopyPassage GUI (edit control)or do you mean highlighted text within external windows like a browser window?
After clarifying this I will try to find the error why your hotkeys just work once. At the moment I have no clue. :)

btw. where (position!) did you add your hotkeys?

Cheers
AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 12th, 2006, 8:25 pm 
Offline

Joined: July 23rd, 2005, 2:13 am
Posts: 52
Sorry about the confusion, I pieced together the code from things I found off the website to make a stand alone script to do some repetitious tasks I do often. Here is the code correction:

Code:
;Google Search
!G::
Send, ^c
ClipWait, 2
word = %clipboard%
run "C:\Program Files\Internet Explorer\iexplore.exe" www.google.com/search?q=%word%
return

;Web Adress Lookup
!W::
Send, ^c
ClipWait, 2
word = %clipboard%
run "C:\Program Files\Internet Explorer\iexplore.exe" %word%
return


I would love it if you could add these two useful functions to your script:

    1. Auto Search in Google - The user may manually high lights text from any source, (like from a text or word documents as well as from a Web Page) Then with the use of hot keys, a new window would be opened then the "target text" would be searched for in the Google search engine. (The benefit of this is that it does not clutter up things like the Google tool bar)

    2. Web Page Look Up - The user may manually high light a web address from a NON-hyperlink source, like a text document. Then with the use of hot keys a new Window would be opened and the user would be taken to the desired webpage. (the benefit comes for people like me who down load a lot of files that are in pieces from rapidshare. You could use AHK CopyPassage to copy the list of site addresses then use this web page look up to auto open a new window to download files from rapid share)

Ok, I just took the above edited code and inserted it into your script after section below:

Code:
 ; ##############################################################################
; ###### End of Autoexec section ###############################################
; ##############################################################################


It worked successfully and though it does work I would like to know is there a better way of writing this code into your script?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2006, 12:46 pm 
Sorry for my late answer. Hadn't much time last week.

Quote:
It worked successfully and though it does work I would like to know is there a better way of writing this code into your script?
Of course there is always a better way. :)

First of all. You use "Alt + ..." combinations for your hotkeys. But these are perhaps commonly used within some programs. So you eventually disable these hotkeys within some programs accidentally.
A good way would be to use e.g. Win-key or Ctrl+Shift+... combinations. Second thing would be to implement your new hotkeys configurable in the same way as the hotkeys for opening the AHK CopyPassage GUI and the copying of contents. I did it as you can see in the Preferences window of CopyPassage.

Second thing is the use of your prefered browser. You hardcode IE within your hotkeys. But some people might want to use their beloved FF or Opera, ...
As the script lets you already specify your perferred browser within the preferences GUI I think this might be an easier task. Another way would be to use the Run command without specifying the path to the browser .exe file. In this way Windows uses the preconfigured browser in the registry for handling .html files. I think this also points to your configured standard browser.

As your two hotkeys sound like a real benefit to CopyPassage I will think about a way to include them within a next version.
__________
Cheers
AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2006, 7:52 pm 
Offline

Joined: July 23rd, 2005, 2:13 am
Posts: 52
Thanks for your expertise. You wrote:
Quote:
use the Run command without specifying the path to the browser .exe file. In this way Windows uses the preconfigured browser in the registry for handling .html files.


My reason for hard coding my browser was because I did not know of any other way make my browser open up a "new window" with the speed of hard coding it the way I did. I attempted to test the run command suggestion with out using the script, it opened and existing web page (which is not what I wanted). I do not know how to implement your suggestion. Please show me, thank you.

Here is alas another suggestion to include into the next version. I, like many, am not the best speller. So when I fight my lazy streaks I look up words online. I wrote this script and I think others would benefit also. I used dictionary.com; of course you could change it to another. If you know of a faster loading dictionary webpage please let me know.

Code:
;Dictionary.com Lookup
!D::
clipboard =
Send, ^c
ClipWait, 2
word = %clipboard%
run "C:\Program Files\Internet Explorer\iexplore.exe" http://dictionary.reference.com/search?q=%word%
return


I do realize the code I used has the same challanges we spoke about before so I'm sure you can modify it/stream line improve it.

I have 3 more great requests.

1. Add to the edit gui a rename file menu item or an Icon that will prompt a window to rename the file. This way after the user has saved the "passage" he wanted the user can then rename the file if he choose for permanent storage.

2. At the same time I think it would be awesome to give the user the ability to automatically create a folder with the same name as the file, I have wanted to create something to do this for a while but I lack the skills.

3. Add hotkeys to create a "new folder" I have long wished Windows had a hotkey to create a new folders where ever you were, with out right click scroll method. I've seen some programs that do this.

Thank you again so much for this program! Huge fan!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2006, 8:18 pm 
Quote:
I did not know of any other way make my browser open up a "new window" with the speed of hard coding it the way I did.
hmm, maybe it's just a question of IE configuration.

Did you try to uncheck the "Reuse windows for launching shortcuts" option in Tools>Internet Options>Advanced?
________
Cheers
AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2006, 8:35 pm 
Quote:
1. Add to the edit gui a rename file menu item or an Icon that will prompt a window to rename the file. This way after the user has saved the "passage" he wanted the user can then rename the file if he choose for permanent storage.
What do you mean with edit gui? When choosing "Edit note" via context menu entry, the note is opened within Notepad. Here you can choose File-SaveAs and save you text file whereever you want. :) Is this what you mean?

I even thought about letting the use rename the .txt files within the ListView for quite some times. But I'm not sure if I will run in some difficulties within the script. E.g. sorting the files, deleting them, ... I think I have to spend some more thoughts on this.

Quote:
2. At the same time I think it would be awesome to give the user the ability to automatically create a folder with the same name as the file, I have wanted to create something to do this for a while but I lack the skills.
Where would you want this folder to be created? And what file name are you talking about? Sorry for not understanding this. The filenames are vera cryptic at the moment. E.g.
Code:
31$01$2006 - 16~29~43.txt
Do you really want to create a folder with the same name? And what would this folder be good for?

Quote:
3. Add hotkeys to create a "new folder" I have long wished Windows had a hotkey to create a new folders where ever you were, with out right click scroll method. I've seen some programs that do this.
You mean within Windows Explorer? Or where would you need a hotkey to create a new folder?
__________
Cheers
AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2006, 12:39 am 
Offline

Joined: July 23rd, 2005, 2:13 am
Posts: 52
Ok I we both wrote a lot so I will clearify one at a time if possible.

In reference to #1: I would like to see two things added: You only have three menu items: File, View, ?

I was hoping for you to add and Edit tab Menu. Under that menu I wanted to see the Edit and Delete items (which you already have when you right click context menu) I would like you to add another item called "Rename File". If you also add it to the context menu that would be even more better lol.

The "Rename File" would perform the following function:
1. When selected it would open a dialog box, inside the dialog box it would show you all the files you have saved (in "notes" folder) with the format you predefined. Then it would allow you to (with the press of an Icon) individually rename the files you currently have into names more suitable for you to store long term.

Old way: Currently you can navigate to the folder "notes", then you can press F2 to rename file.

Improved way: Would shorten and simplify the process. I use a awesome program called: Tag&Rename, one of its features is a file renaming it saves you time so you avoid navigating to file folders then going through the individual renaming process. Anything that saves time I love. Use AHK CopyPassage daily. I download a lot software and files, your script helps to save the Software desciption and or install instructions/serials for later storage, your program saves me tons of time. This added feature would further save me and others who do what I do time.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Second Item explaination
PostPosted: March 19th, 2006, 1:19 am 
Offline

Joined: July 23rd, 2005, 2:13 am
Posts: 52
Quote:
Where would you want this folder to be created? And what file name are you talking about? Sorry for not understanding this. The filenames are vera cryptic at the moment.


In my other post I stated I download a lot of programs, music, serial etc. I use your program to quickly save info. After I have saved the info I manually locate the downloaded program, serial, info then I create a folder most often with the name of the program I downloaded.

If you could include this second suggestion of adding a menu item plus function to auto create a folder naming the new folder the name of the text file that would save time too. A program called FileNote does something similar to this but it only creates a text file from the name of and exe file: it would take the file names CounterStrike.exe and the create a text file named: CounterStrike.txt then it opens the text file for you to type into it. FileNote is very useful but lacks more fuctionality. It is limited to only creating text file from exe files.

I would like for you to include into AHK CopyPassage a menu and a context menu item Called MFolder. This would allow you to select a text file from within the "notes" folder then create a new folder with in "notes" folder then name that folder the name of the selected text file. And if that wasn't enough lol how about have it auto move the text file into the newly created Folder right after it creates the new folder. lol... seriously no joke that would be awe inspiring. What time this would save the user!

And to be clear the create folder name would used after the user has changed the text file name to more useable name for long term storage.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2006, 1:50 am 
Offline

Joined: July 23rd, 2005, 2:13 am
Posts: 52
The last on the wish list was the universal new folder hotkey.

I was in fact speaking of Windows Explorer new folder function. I wish MS would make a hot key so where ever you were navigation wise you could simply press a hotkey series and a "New Folder" menu would pop up allowing you to name it what you wanted. I've seen some other program out on the market perform this task (CreativeElementPowerToolsXP 1.9.650)

And last lastly lol, in reference to:

Quote:
maybe it's just a question of IE configuration.

Did you try to uncheck the "Reuse windows for launching shortcuts" option in Tools>Internet Options>Advanced?


I was unaware of this property thank for showing it to me. Aside from this how exactly could I implement your suggestion with the run command with this code:
Code:
;Dictionary.com Lookup
!D::
clipboard =
Send, ^c
ClipWait, 2
word = %clipboard%
run "C:\Program Files\Internet Explorer\iexplore.exe" http://dictionary.reference.com/search?q=%word%
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2006, 2:26 pm 
Ok afterburner, made some more thoughts on your requests :D

#1
Renaming the files within the listview would definitely be a problem at the moment. I need the textfiles with my predefined format because I extract a machine-readable date-time stamp which is put inside a hidden second column within the listview. I need this for sorting, because the listview control doesn't support sorting by dates without this workaround.

But what do you think about combining request #1 and #2 and creating an "Export" entry within the context menu. (I also think about adding your proposed edit menu witin the menu bar). Don't worry, I will explain how I mean this:

Let's assume you're looking at the CopyPassage GUI. You highlight one of the textfiles within the listview and right-click for the context menu. Here you would choose the new entry "Export..." This opens up a new, small GUI that lets you enter a sensemaking name.
After entering this new name, CopyPassage creates a new folder with this name, moves the highlighted textfile to this new folder, renames the textfile to the same name as the foldername (foldername.txt) and deletes the source textfile from the notes folder. After this, the ListView control will be rebuild and the entry has disappeared.
The new folder could be created within the notes subfolder just as you suggested. Another option might be to add an edit control to the preferences screen that lets the user specify an export directory where copy passage would create this new folder. This directory could be saved permanently to the CopyPassage .ini file.
So what do you think about it?

#3
Concerning "NewFolder" hotkey. I tried to make this little script:
Code:
#w::
  Send, {Alt}{Down}{Enter 2}
Return

Could you please try if this creates a new folder. The shortcut is Win+W


btw. have you tried to uncheck "Reuse windows for launching shortcuts" within IE?

Does the run command e.g.
Code:
Run, http://www.autohotkey.com
still open within an existing instance of IE or does it open a new window.

And one last thing. I think you won't need the whole path to the iexplore.exe within your little scripts because Windows already saved the path somewhere within its path variables.
Would you try to check if that works?

Code:
;Dictionary.com Lookup
!D::
clipboard =
Send, ^c
ClipWait, 2
word = %clipboard%
run, iexplore.exe http://dictionary.reference.com/search?q=%word%
return

_________________
Cheers
AGU
Image


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2006, 2:31 pm 
Quote:
I was unaware of this property thank for showing it to me. Aside from this how exactly could I implement your suggestion with the run command with this code:

Code:
;Dictionary.com Lookup
!D::
clipboard =
Send, ^c
ClipWait, 2
word = %clipboard%
run "C:\Program Files\Internet Explorer\iexplore.exe" http://dictionary.reference.com/search?q=%word%
return


One way of making the run command user configurable would be to save the path to your browsers .exe to a variable and call the run command with this variable:

Code:
var = "C:\Program Files\Internet Explorer\iexplore.exe"
run, %var% http://dictionary.reference.com/search?q=%word%

________________
Cheers
AGU


Report this post
Top
  
Reply with quote  
PostPosted: March 19th, 2006, 7:03 pm 
Offline

Joined: July 23rd, 2005, 2:13 am
Posts: 52
Your suggestion for #1 is perfect. Please please implement that.

What do you think about additionally creating a second hotkey to additionally do your suggestion from the beginning.

So your solution would be implemented in the third hotkey/menu item and an additional Third hotkey would to it seemingly from the start (could this be a work around?)

-First hotkey: (This is what you have done already) saves it with time stamp.

-Second hotkey: First creates text file with time stamp then it auto prompts user to do our improved method (What is done by the Third hotkey).

-Third hotkey:(for individual renaming) Does the file rename/folder with that name/move thing.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Run command solution
PostPosted: March 19th, 2006, 7:10 pm 
Offline

Joined: July 23rd, 2005, 2:13 am
Posts: 52
Quote:
"Reuse windows for launching shortcuts" option in Tools>Internet Options>Advanced?


This suggestion did work.

So now:

Code:
;Dictionary.com Lookup
!D::
clipboard =
Send, ^c
ClipWait, 2
word = %clipboard%
run, iexplore.exe http://dictionary.reference.com/search?q=%word%
return


Works perfectly, thank you so much. By unchecking that bugger the code works great. When I installed Windows XP I believe its default was to check that box. How could that box be unchecked progamatically?


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Universal "NewFolder"
PostPosted: March 19th, 2006, 7:37 pm 
Offline

Joined: July 23rd, 2005, 2:13 am
Posts: 52
I attempted to use your code:
Code:
#w::
  Send, {Alt}{Down}{Enter 2}
Return


First attempt: I opened up "Windows Explorer", then I used the hotkey
Test failed it opened up a existing folder.

Second attempt: I went to the desktop, then I used the hotkey.
Test failed it opened up an existing webpage shortcut.

Third attempt: I opened up "Windows Explorer\test folder", then I used the hotkey.
Success


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 61 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Stigg and 20 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