rivet Posted December 18, 2003 Posted December 18, 2003 FMP6 osX 10.3 Can I have applescript open window centred in screen?
Lee Smith Posted December 18, 2003 Posted December 18, 2003 Hi rivet, FileMaker will open it's Windows of a file where ever it was located on your screen prior to being closed. Try putting the window where you want it to open, and then close it. When you reopen it, it should be where you last put it. Side note, if this is a solution you are developing for a third party, you might want to ask them where they want the window, or show them how it works. Also, different rolsultions, screen sizes, etc will affect your results. Here are a couple of Technical Articles by FileMaker Inc: http://www.filemaker.com/ti/105759.html http://www.filemaker.com/ti/104768.html and a couple of files that may help you: Auto Layout Navigation For Screen Resolution by: Dwayne Wright http://www.afilemakeraffliction.com Small Screen by: Claris http://www.fmfiles.com/dev7.html Toggle Field Display by: Parker Bennett http://www.databasepros.com Window Size by: Ken Edwards http://www.databasepros.com HTH L
rivet Posted December 18, 2003 Author Posted December 18, 2003 Thanks Lee, I will take a look. I should mention that I did have a script for os9, but osX does not like it. tell application "Finder" copy the bounds of the window of the desktop to {Sx, Sy, SW, SH} end tell tell application "FileMaker Pro" copy the bounds of the window 1 to {Fx, Fy, FW, FH} set ctrHor to ((SW - (FW - Fx)) / 2) set ctrVer to ((SH - (FH - Fy)) / 2) set the bounds of window 1 to {ctrHor, ctrVer, ctrHor + (FW - Fx), ctrVer + (FH - Fy)} end tell
Lee Smith Posted December 18, 2003 Posted December 18, 2003 Hi rivet, Kind of an important omission there don't you think? Sorry, AS and I don't play well together. However, if no one else here has the answer, I'd try one of the other FileMaker lists, here are three: Blueworld: http://www.blueworld.com/blueworld/lists/lasso.html Dartmouth: http://listserv.dartmouth.edu/scripts/wa.exe?SUBED1=fmpro-l&A=1 FM Experts: http://www.ironclad.net.au/lists/FMPexperts/index.html HTH Lee
Fenton Posted December 18, 2003 Posted December 18, 2003 rivet, it sounds like you've pretty much got it. Not being booted in OS X at the moment, I can't test. But I imagine your AppleScript error has to do with the exact syntax of calling the "desktop" (try "desktop folder"). They changed it slightly as I remember. But I don't think you need to call the desktop. You can use the FileMaker functions, Status(CurrentScreenWidth) and Status(CurrentScreenHeight) for that info. Another cute trick (if I do say so) is the Design function, FieldBounds. You can put a 1x1 pixel field (global, used only for this) in the lower right corner, and get the field bounds. The 3rd and 4th numbers (words) can be used for the window size.
Fenton Posted December 18, 2003 Posted December 18, 2003 I found the following in an AppleScript someone made for OS X. Perhaps there's a shorter way, but this seems to work. tell application "Finder" set {c, d} to screen size of item 1 of (screen list starting with main screen) end tell I'm in OS X now, so don't know if it works in 9 or not.
Ugo DI LUCA Posted December 19, 2003 Posted December 19, 2003 Just in case... Related thread Link to the demo
Recommended Posts
This topic is 7644 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now