Thanks but I already said I can get all the processes. If you know which keyword and\or flag I should use to get applications from ps then that is fine.
PS: I can get them using an applescript, I would prefer doing programmatically instead if I can rather than parsing output of a shell command.