Jump to content

Just hear me out!


Recommended Posts

Ok. so i have this program that sends emails.

I want to know how to set it so when i click on a mailto link,

the program opens and sets the to address to what i clicked.

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Link to comment
Share on other sites

OK. The script wont help, but here is an example stretched out...

I have an email program, to send emails.

I already have set up that this is my default program to run after i click on a mailto link online.

What i want to know is, what can i add to my script, to make it so when i click on a mailto link online,

it opens my program, and fills in the address. Normally it just opens a blank email program.

its kind of like: Run("myprogram.exe -address") idk, something like that, but with out run inside the script.

Is that clearer?

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Link to comment
Share on other sites

OK. The script wont help, but here is an example stretched out...

I have an email program, to send emails.

I already have set up that this is my default program to run after i click on a mailto link online.

What i want to know is, what can i add to my script, to make it so when i click on a mailto link online,

it opens my program, and fills in the address. Normally it just opens a blank email program.

its kind of like: Run("myprogram.exe -address") idk, something like that, but with out run inside the script.

Is that clearer?

Run(@ComSpec & ' /c start "" "mailto:user@domain.com?subject=subject here"',"",@SW_HIDE)

?

Edit: oops...totally misread your question.

You need to actually add a key in your registry so that Windows knows what commandline to run (the path to your script) when a mailto: link is clicked.

Edit 2: try editing the "default" value under hklm\software\classes\mailto\shell\open\command ...modify the path to the path of your script, followed by a space and %1. That will send the e-mail address specified in the mailto: link as a string parameter to your script. Then your script will need to read that parameter, and set that as the e-mail address. Remember it will need to split the string apart at the ? in case the link specifies a subject or cc as well as a to: address (like the link I wrote above). The key is the %1 which, in Windows Registry world kind of means "send the path of whatever called me".

Edited by james3mg
"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Link to comment
Share on other sites

im not too experienced with REG stuff. i actually find that to be the hardest with autoit...

But thanks anyway... that is what im talking about...

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Link to comment
Share on other sites

im not too experienced with REG stuff. i actually find that to be the hardest with autoit...

But thanks anyway... that is what im talking about...

Haven't tried StringRegExpReplace or DLL calls yet, have you? :mellow:

j/k. So did adding the %1 work? If you need your script to do it, make sure it's got administrative rights (#requireadmin), then call RegWrite("HKLM\Software\classes\mailto\shell\open\command","","REG_SZ",@ScriptFullPath & " %1")

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Link to comment
Share on other sites

no. so your saying every time i use the program, the admin thing comes up?

well, heres the thing... it shouldn't be just for me. if any one who uses it wanted to make it the

default, it should do what i have said.

Edited by billthecreator

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Link to comment
Share on other sites

no. so your saying every time i use the program, the admin thing comes up?

well, heres the thing... it shouldn't be just for me. if any one who uses it wanted to make it the

default, it should do what i have said.

But you can't edit the registry without admin permissions. Best case, make a separate script that does nothing but edit that string in the registry that has #requireadmin at the top, and ONLY call that script if you find that your program isn't the default (and/or the user indicates they wish your program to be made the default). Then in Vista and 7, the UAC will only prompt the user when you're going to CHANGE the default e-mail program.
"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...