I trying to get or set the dimensions of an open window on Mac using these unix commands
// gets window size
Dim sb As New Shell()
sb.Execute ("xdotool getwindowgeometry -shell $WINDOW_ID")
MsgBox getwindowgeometry //nothing happens
//sets window size nothing happens
Dim sd As New Shell()
sd.Execute ("xdotool windowsize $id 500 500")
I suspect you should be looking at sb.result to parse the output from xdotool.
ok wayne I’ll try that, I’m a super newbie can you tell
here is what I got:
bash: xdotool: command not found
are you trying to change the dimensions of a window in YOUR app?
or the window size of an app already running on the computer?
the window in the Finder on Mac. I search for files and open folders all day long. I like to place and size the folder that opens.
Is there a UNIX command to do this. also, is there a UNIX shell command to list files in a folder?
You can’t change the window geometry on Mac OS.
For Linux and OS X (and other Unix OSes):
With theShell as a Mode 0 Shell, use:
theShell.Execute "ls -l """ + theUnixPath + """"
theTextArea.Text = theShell.ReadAll
It’s best to get he Unix shell path unescaped (i.e.:
/Library/Application Support/BRU PE
/Library/Application\ Support/BRU\ PE
And enclose the path in quotes.
If you want to list files in a folder, I’d suggest you collect the files via Xojo instead of a shell command. Xojo comes with MANY examples, and they are often a very good resource for learning how to do things. For example:
- Menu File > New > Examples > Files > FileBrowser.xojo_binary_project
I suggest you study that example. You can also use its techniques to open windows with file lists INSTEAD of the Finder windows. Then you can control the size and placement of them easily using window properties. It may solve many of your problems…
Instead of trying to manipulate Finder, why not do what Douglas mentinon, and collect via Xojo, store in a Database, and create an app to display ONLY those to you in a Xojo window that you now have full control over… basically a MRUF app (Most Recently Used Files)
Or even not bother to store in a file. The Xojo example isn’t all that slow to just refresh folders on demand. Unless you have a lot of files in a given folder. Then I’d suggest the MBS plugin FileListMBS which also is used in several example MBS projects (see bottom of the above page).