Clipboard HTML Help

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
lennshow66
Posts: 3
Joined: 11 Jun 2018, 06:59

Clipboard HTML Help

11 Jun 2018, 07:13

Hi All,

I have a script that i've created that is similar to below. What I would like to be able to do is make the line that says "Please find your files here" into a hyperlink. The link will be different every time and should come from the clipboard. Is this possible?

Thanks

Code: Select all

^l::Function3_Function()
^e::Function4_Function()

Function3_Function(){
Send, [email protected]
Send {Tab}
Send {Tab}
Send {Tab}
Send {Tab}
Send, Please find your files here.
Send {Enter}
Send {Enter}
^v
send {Enter}
send {Enter}
Send, Thanks
}

Function4_Function(){
Send, [email protected]
Send {Tab}
Send {Tab}
Send {Tab}
Send {Tab}
Send, Please find your files here.
Send {Enter}
Send {Enter}
^v
send {Enter}
send {Enter}
Send, Thanks
}
lennshow66
Posts: 3
Joined: 11 Jun 2018, 06:59

Re: Clipboard HTML Help

12 Jun 2018, 02:43

Hi All,

I have got this working with help from Google. Now I'm struggling with including this script in my original script. When I run this script within my original it just clears out all of the text and leaves the hyperlink behind. Anyone got any ideas?

Thanks

Code: Select all

^i::
Body = 
(join<br>
<a href='%clipboard%'>HERE</a>

)

oL := ComObjActive("outlook.application")
Mail:=oL.Application.ActiveInspector.CurrentItem 
Mail.HTMLBody:= Body 
return
Guest

Re: Clipboard HTML Help

12 Jun 2018, 06:51

You need to include the entire text of your message in the BODY variable - not sure if the join<br> is actually doing what you want but can add <br> for each empty/newline you want

Code: Select all

Body = 
(join<br>
Please find your files <a href='%clipboard%'>HERE</a>.

Thanks
Joe Jones, Customer Support Extraordinaire.
)
lennshow66
Posts: 3
Joined: 11 Jun 2018, 06:59

Re: Clipboard HTML Help

15 Jun 2018, 08:23

Great thanks.

Any way I can still include the Autohotkey commands within this script?

Thanks
User avatar
FanaticGuru
Posts: 1906
Joined: 30 Sep 2013, 22:25

Re: Clipboard HTML Help

15 Jun 2018, 12:40

lennshow66 wrote:Hi All,

I have got this working with help from Google. Now I'm struggling with including this script in my original script. When I run this script within my original it just clears out all of the text and leaves the hyperlink behind. Anyone got any ideas?

Thanks

Code: Select all

^i::
Body = 
(join<br>
<a href='%clipboard%'>HERE</a>

)

oL := ComObjActive("outlook.application")
Mail:=oL.Application.ActiveInspector.CurrentItem 
Mail.HTMLBody:= Body 
return
This is handled like any other string manipulation.
If you want the information in Body to be before the existing information in Mail.HTMLBody, you just do that:
Mail.HTMLBody:= Body Mail.HTMLBody

It is just like assigning any other string to a variable. You can build the string to assign any way you want.
Mail.HTMLBody:= "New Stuff Here >>>" Body "<<< New Stuff Here`nOld Stuff Here >>>" Mail.HTMLBody

Also as stated above, now that you are using COM, I would not bother with any of the Send stuff and just do it all with COM. My example of string manipulation is very important when constructing a reply email as you normally want to keep the existing email chain in your email.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Joey5, RandomBoy and 402 guests