Jump to content


Photo

copy text and send to another program?


  • Please log in to reply
23 replies to this topic

#1 debudebu

debudebu
  • Members
  • 6 posts

Posted 04 June 2008 - 05:57 AM

I'd like to be able to copy some text (Without the " - " symbol ) off a web page or from a text file, then have it sent automatically to another open program's search field, then have the "search" button automatically clicked. It would be nice if after those steps I was then sent back to the opened web page or text file. Is this doable with AHK?



I think I have the script for the first part figured out below, I just need some tips to combine with the above. thanks!

active := true
return

PAUSE::active := !active ; toggle

OnClipboardChange:
if active
StringReplace, Clipboard, Clipboard, -, , all
return

#2 BoBo²

BoBo²
  • Guests

Posted 04 June 2008 - 04:21 PM

off a web page or from a text file,

Which one(s)?

to another open program's search field

Which one?

#3 debudebu

debudebu
  • Members
  • 6 posts

Posted 04 June 2008 - 06:40 PM

off a web page or from a text file,

Which one(s)?

to another open program's search field

Which one?


Text file

soulseek

Is this doable?

#4 tank

tank
  • Members
  • 4100 posts

Posted 05 June 2008 - 12:37 AM

there is so much wrong with this post but i think the links in my sig will help with them all but seriously you shout dry
searching first
posting a more specigfic better worded question
describe what you have already tried or found thats related that didnt work
oh never mind why am i even posting this

#5 purloinedheart

purloinedheart
  • Members
  • 538 posts

Posted 05 June 2008 - 12:46 AM

Fill in the blank

#Persistent

OnClipboardChange: 
IfWinActive __________ ;Window title
 StringReplace, Clipboard, Clipboard, -, , all 
return


#6 debudebu

debudebu
  • Members
  • 6 posts

Posted 05 June 2008 - 07:19 AM

there is so much wrong with this post but i think the links in my sig will help with them all but seriously you shout dry
searching first
posting a more specigfic better worded question
describe what you have already tried or found thats related that didnt work
oh never mind why am i even posting this


There's also something seriously wrong with your spelling and grammar, but you don't see me recommending a dictionary or a 3rd grade teacher. I was simply asking if what I wrote in the above paragrah was "Possible" with AHK.

@ purloined heart, thanks that was helpful.

#7 bounce2

bounce2
  • Members
  • 14 posts

Posted 09 October 2009 - 04:14 AM

Fill in the blank

#Persistent

OnClipboardChange: 
IfWinActive __________ ;Window title
 StringReplace, Clipboard, Clipboard, -, , all 
return


This thread is exactly what I'm trying to do. In the "fill in the blank" as suggested above I tried putting slsk.exe :

OnClipboardChange:
IfWinActive slsk.exe ;Window title
StringReplace, Clipboard, Clipboard, , , all
return

Can someone give a tip to an ahk noob? thanks

#8 bounce2

bounce2
  • Members
  • 14 posts

Posted 09 October 2009 - 06:43 AM

I'd be willing to donate 10 via paypal to anyone who can help me out with this. thanks

#9 aaffe

aaffe
  • Members
  • 1024 posts

Posted 09 October 2009 - 07:57 AM

untested! Start with Win+t
#t::
  IfWinActive,<Title>
  Send, ^c
  Stringreplace,text,clipboard,-,,all
  WinActivate,<Second Window-Title>
  Send,^v
  ControlClick,<Buttonnameforsearch>
REturn


#10 closed

closed
  • Members
  • 509 posts

Posted 09 October 2009 - 09:06 AM

This thread is exactly what I'm trying to do. In the "fill in the blank" as suggested above I tried putting slsk.exe



A window title is needed not the process name.Can you check if the title of the window is really slsk.exe?


I would try Aaffe's code that seems a solution.

If needed you can use SetTitleMatchMode 2 to make a partial windowtitle match work.( see helpfile for settitlematchmode )

#11 bounce2

bounce2
  • Members
  • 14 posts

Posted 09 October 2009 - 05:48 PM

This thread is exactly what I'm trying to do. In the "fill in the blank" as suggested above I tried putting slsk.exe



A window title is needed not the process name.Can you check if the title of the window is really slsk.exe?


I would try Aaffe's code that seems a solution.

If needed you can use SetTitleMatchMode 2 to make a partial windowtitle match work.( see helpfile for settitlematchmode )


thanks yume and aaffe
searching forum for how to find specific wintitle (you're right slsk.exe is the process) isn't giving me much.. . Can anyone give me a pointer on how to figure that out? thanks

#12 closed

closed
  • Members
  • 509 posts

Posted 09 October 2009 - 06:00 PM

Window title is the text you see as title of the window on your screen.If you open Notepad,the window title displayed is Untitled-Notepad.

This small program will give you the window title of the active window on your screen as tooltip in real time.Just to give an idea :D

#Persistent
SetTimer, WatchActiveWindow, 1000
return
WatchActiveWindow:
WinGetTitle, title,A
ToolTip, %title%
return

I had to replace text by clipboard to make it Aaffe code work.You highlight the text in the first application ,then you activate the hotkey win+t ,the program will activate the destination window and paste the modified clipboard in it.(the second program must be running!)

#t::
  IfWinActive,<Title>
  Send, ^c
  Stringreplace,clipboard,clipboard,-,,all
  WinActivate,<Second Window-Title>
  Send,^v
  REturn


#13 bounce2

bounce2
  • Members
  • 14 posts

Posted 09 October 2009 - 06:17 PM

untested! Start with Win+t

#t::
  IfWinActive,<Title>
  Send, ^c
  Stringreplace,text,clipboard,-,,all
  WinActivate,<Second Window-Title>
  Send,^v
  ControlClick,<Buttonnameforsearch>
REturn


The program I want to send text "from" is mozilla firefox, and I'd like to be able to send from various pages but the wintitle is different for each website. Do I need to have a specific script for each website? Or can the wintitle just be "mozilla firefox (build 20090824101458)" ??

#14 closed

closed
  • Members
  • 509 posts

Posted 09 October 2009 - 06:27 PM

Hi Bounce 2

I was still changing the post i made earlier because i tried it and it did not worked.

The windowtitle should be shown as a tooltip attached to the mousepointer ,i just tried it again and it seemed to work on XP......

I had to replace text with clipboard in Aaffe's code.You can see in my earlier post the new code.

You can set as first line:

SetTitleMatchMode 2

Then if the title contains part of the title you give in the code there will be a match.So you can use Mozilla Firefox as title ( i guess it will be on every webpage in the title)


SetTitleMatchMode 2

#t::
  IfWinActive,<Title>
  Send, ^c
  Stringreplace,clipboard,clipboard,-,,all
  WinActivate,<Second Window-Title>
  Send,^v
  REturn


#15 bounce2

bounce2
  • Members
  • 14 posts

Posted 09 October 2009 - 06:39 PM

Hi Bounce 2

I was still changing the post i made earlier because i tried it and it did not worked.

The windowtitle should be shown as a tooltip attached to the mousepointer ,i just tried it again and it seemed to work on XP......

I had to replace text with clipboard in Aaffe's code.You can see in my earlier post the new code.

You can set as first line:

SetTitleMatchMode 2

Then if the title contains part of the title you give in the code there will be a match.So you can use Mozilla Firefox as title ( i guess it will be on every webpage in the title)


SetTitleMatchMode 2

#t::
  IfWinActive,<Title>
  Send, ^c
  Stringreplace,clipboard,clipboard,-,,all
  WinActivate,<Second Window-Title>
  Send,^v
  REturn


Hi I got your wintitle script working :)

I"m still not able to get the copied text to send from firefox to soulseek. Here is what I replaced:

SetTitleMatchMode 2

#t::
IfWinActive,<Mozilla firefox>
Send, ^c
Stringreplace,clipboard,clipboard,-,,all
WinActivate,<Second Window-Soulseek [db123] - [File Search]>
Send,^v
REturn


db123 is a username (but not my real one :) )
Can you see anything I'm doing wrong there?
Does SetTitleMatchMode 2 affect the second window as well, could I just put soulseek instead of Soulseek [db123] - [File Search]

? thanks again