Corey-Troy Posted November 8, 2010 Posted November 8, 2010 I am creating a script to Close a file. I originally set the button to Exit the Application, but found in the instance that a use had more than one file opened, they were all closed. Is there a way to say : IF(.fp7 Files Opened =1;Exit Application Else Close Current File Only ?
Corey-Troy Posted November 8, 2010 Author Posted November 8, 2010 This SEEMS to work: IF(DatabaseName<>"DB01";Close File); Else Exit Application End IF
comment Posted November 8, 2010 Posted November 8, 2010 How about : If [ DatabaseNames = Get ( FileName ) ] Exit Application Else Close File [ Current File ] End If or: If [ ValueCount ( DatabaseNames ) > 1 ] Close File [ Current File ] Else Exit Application End If This way you can rename your file without breaking the script.
Corey-Troy Posted November 8, 2010 Author Posted November 8, 2010 Perfect. Thanks... I will use the first script based on the file name opened.
Vaughan Posted November 8, 2010 Posted November 8, 2010 May I suggest you NOT exit the application. You are assuming that your solution is the only one the user has open. I find nothing more frustrating than closing a database, only to find it quits FMP and all the other databases I had open.
Corey-Troy Posted November 8, 2010 Author Posted November 8, 2010 The whole principle i want is to Exit the Application, but IF another file on the users PC i opened, then only to Close the current file to not cause that frustration.
Recommended Posts
This topic is 5130 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