I'm trying to close an open window in Preview by using the terminal. Everything that I have found on the internet suggests using AppleScript instead, but I cannot do such since the plist option does not exist for me (to enable osascript for preview as indicated here on Super User). I am running OS X 10.8.2.
I should note here that I don't really care for AppleScript, and would much prefer a bash solution.
To reiterate, I have a .pdf open in Preview, and I want to close the specific window accessing and displaying the file rather than terminating the entire program. I think this is possible, since there is a way with the OS to kill the window without bash.
I would also like to know how the OS interfaces with the shell when it closes a subprocess (window) of an application.
I can find the open .pdf, process, socket, node, et c. with lsof, but I am hesitant to go further with such information since AFAIK, I can kill the entire process (overkill) or close the port/socket (weird kill) with that information.
Thanks for helping me with this problem. It's really bothering me that my google abilities are failing me.
edit: added in Super User link for osascript enabling to add context.
man psthenman killno need to look on the internet.