bigzilla Posted March 1, 2005 Share Posted March 1, 2005 Why is it that I can run a script in one Layout and it works perfectly. Then I call the same script from another file and it doesn't work the same way. I have a script that in my [Lines] file opens up the "Report layout" and centers the screen. When I call this same script from my [Customer] layout, it opens the [Lines] file and the "Report" layout, but the screen is at the bottom right of my screen. But if I run the script again from my [Lines] file, the "Report" layout centers in the screen! What gives? In other versions of FMP, you called a script an it did just as it would as if you were in that file. Is there something else I need to do that is unique to 7? BTW I'm using the separate file method if that makes a difference. I've messed with this for a couple days now trying different things, but I've run out of ideas. Thanks for your help, Bill Link to comment Share on other sites More sharing options...
Ender Posted March 1, 2005 Share Posted March 1, 2005 Maybe you can post the exact script steps involved. Link to comment Share on other sites More sharing options...
bigzilla Posted March 1, 2005 Author Share Posted March 1, 2005 Hi Ender and thanks for your reply. The script I'm using is; Allow User Abort [Off] Set Window Title [Current Window; New Title “Mailâ€] Go to Layout [Reports] (Restof) Commit Records/Requests () Set Zoom Level [75%] Set Zoom Level [100%] Adjust Window [Resize to Fit] *Move/Resize Window Refresh Window *Window Name Height: Get ( WindowContentHeight ) + 37 Width: Get ( WindowContentWidth ) + 15 Distance from top: (Get ( ScreenHeight ) - Get ( WindowContentHeight )) / 3 Distance from left: (Get ( ScreenWidth ) - Get ( WindowContentWidth )) / 2 As I said it works great in the file it resides, but does not work correctly when called from a different file. Bill Link to comment Share on other sites More sharing options...
-Queue- Posted March 1, 2005 Share Posted March 1, 2005 If the external file is active, then Current Window refers to that file's window. I would think this could be a major problem. Link to comment Share on other sites More sharing options...
bigzilla Posted March 1, 2005 Author Share Posted March 1, 2005 Hi Ender, I took the Current window step out but it does not work. Let me ask the question differently. How would you write a script that goes to another file and opens a layout in the middle of the screen. That's all I really want to do! Thanks Ender, Harry Link to comment Share on other sites More sharing options...
Ender Posted March 1, 2005 Share Posted March 1, 2005 Maybe adding a Select Window step at the top will help to get the focus on the right window. Link to comment Share on other sites More sharing options...
bigzilla Posted March 1, 2005 Author Share Posted March 1, 2005 Nope, same thing. It's fine in the layout it's in. But when I call it from another file it opens at the bottom of the screen. Bill Link to comment Share on other sites More sharing options...
FileMakin' Tom Posted March 2, 2005 Share Posted March 2, 2005 In the file you are leaving, write: Toggle window (Minimize) Perform Script (External) This to call the script which centers the window in the target file. Be well . . . Tom Link to comment Share on other sites More sharing options...
-Queue- Posted March 2, 2005 Share Posted March 2, 2005 You may want to reverse the steps so that the window isn't activated again after you've minimized it. Link to comment Share on other sites More sharing options...
bigzilla Posted March 3, 2005 Author Share Posted March 3, 2005 Hi Guys, Well, I think I'm missing something here. Maybe I'm putting the script steps in the wrong place, but it's not working. Maybe you can spell that out for me a little more! All I want to happen when this script is called is to center the window, regrdless of where someone left it. If they want to move the screens, that's fine, but when the script is called, I need to have the layout centered on the screen from one file to the next. Don't quit on me now guys, I think we're almost there! Bill Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.