running a console app automatically when running PPP


i've written a tiny console app (in C) that gets my IP address assigned to me by my ISP, creates an HTML redirect page, then uploads it to my website [which my ISP host]...

...[so that when i'm connected, certain pages are redirected back to my local site on my Mac! - well i think it's cool!]

anyway, i have 2 problems.

1. How can i Execute a console app via the GUI i.e. i just wanna click on it.

2. How can i make the console app automatically execute when i connect to the Internet, via PPP....

any help/ideas welcome... :) know you could use a dynamic dns service that would pretty much do this (like <a href="">DynDNS</a>).

If you name you console app "app_name.command", whenever you double click on it, the terminal will open up and it will run in it's own (tiny) window.

Dunno how to attach anything to connecting via PPP...I've been trying to figure out how myself. It was easy on Linux...[sigh].
thanks for the top tips.... : i'll think i'll try the dynamic dns thingy this time.... but the tip about myapp.command will be useful when i write [as i'm sure i will!] some more console apps..