More help on hiding apps (noob)

I am still attempting to hid my VPNClient, because it annoys me that it has to be in the dock all of the time.

I currently writing a scriptwhich will detect whether my VPNClient is open, and launch my VPNClient, type in the password, and then hide it if it is not launched… And disconnect and exit if it is already launched. Everything seems to be working well, but I cannot seem to find a way to hide the application once it is connected. The problem lies here. I have edited the by adding “LSUIElement 1” This line launches the application without a dock icon, and consequently no menu-bar. Further, I can’t seem to make the applescript lines bellow work either. So, I am confused. Can anyone think of any work around on this?

tell application “Finder”
set visible of process “VPNClient” to false
end tell


tell application “System Events” to set visible of process “VPNClient” to false


tell application "System Events" to set visible of every process of "VPNClient" to false

I think that’s the syntax anyway, I can’t find my own examples at the moment.

The trick, if mine is wrong (someone else can correct me) is getting “every” process of an application to go invisible. I’ve found just setting the application’s process alone doesn’t always work. I don’t know enough about “processes” to understand why, so I just started using “every process of” to solve the problem…makes sure things disappear.