Mif Posted December 11, 2007 Posted December 11, 2007 (edited) I want to be able to return to the file I left from using a script. When leaving I "Set Variable [$$filename; Value:Get(FileName)] and placed this value in a field. How do I get back that filename value? Edited December 11, 2007 by Guest Tried to simplify question.
Fitch Posted December 11, 2007 Posted December 11, 2007 Global variables are file-based, so I don't see how that does you much good. Be that as it may, you say the value is in a field. How do you get it back? Not sure what you mean: you simply reference the field in a script or calculation. E.g., Set Variable( $myFile ; fieldWhichContainsFileName )
Vaughan Posted December 11, 2007 Posted December 11, 2007 Pass the data between files using script parameters and script results.
Mif Posted December 11, 2007 Author Posted December 11, 2007 you simply reference the field in a script or calculation. Thanks. "Open File doesn't offer a calculation so I am trying to use "Open URL" but it's not working for me. Here is the calculation I am using with Open URL: "file:" & "Standard 14a::testTempFilename" & ".fp7" (testTempFilename contains the filename without extension)
comment Posted December 11, 2007 Posted December 11, 2007 But why is this necessary? What is gained by merely opening a file? I have a feeling you want something else - which could perhaps be accomplished without this elaborate workaround.
Stuart Taylor Posted December 11, 2007 Posted December 11, 2007 I am a little confused but rather than storing the last file you were on. You may be better off managing this by storing and calling on the last window name you were on.
Mif Posted December 11, 2007 Author Posted December 11, 2007 Comment and Stuart, Thanks for your help. Here is exactly what I am trying to do: I am trying to create a navigation history which will allow the user to move forward and backward through all files, layouts and tabs they have viewed. (my solution uses multiple tables across multiple files) The navigation history is recorded in a separate table. Initially when leaving a layout, I pull the filename, layoutname and tab link name (specific item on given tab which responds to Get ActiveLayoutObjectName) and place it in that navigation file as well as set my destination table with the navigation key (from the nav file). To navigate backward or forward I will call up those same fields using local and external scripts that will take me to that file, layout and tab. The layout and tab information will be given to a script in the destination file, once I get to that file. This is where I run into the problem. What exactly should I do to open that filename which I pull out of the navigation file? This is where my former comment comes in. "Open File" doesn't allow a calculation. I had read that "Open URL" would work with a file but using the calculation shown a few posts previous, didn't work for me. I'm sure there must be something obvious that I am missing but I think I'm stuck in the dumb zone right now.
Stuart Taylor Posted December 11, 2007 Posted December 11, 2007 (edited) Is there a reason that you have multiple tables in multiple files? would the easier solution not be to navigate between Tables and not files? you could create "File References" in one file to bring it all together. Edited December 11, 2007 by Guest
Genx Posted December 11, 2007 Posted December 11, 2007 "file:" & "Standard 14a::testTempFilename" & ".fp7" ... that won't work, it needs to be a fully qualified URL - it is not relative to your FM file e.g: "file:///C:/Documents and Settings/John Doe/Desktop/SomeFile.txt"
Mif Posted December 11, 2007 Author Posted December 11, 2007 (edited) would the easier solution not be to navigate between Tables and not files? Yes I completely agree, but that is slowly evolving and I haven't got the time for the renovation. Meanwhile is their a way to open or go to a filename using a script? Edited December 11, 2007 by Guest
David Jondreau Posted December 12, 2007 Posted December 12, 2007 If[0] Else If[$$fileName = JoeBob.fp7] Open File[JoeBob.fp7] Else If[$$filename = JerryLee.fp7] Open File [JerryLee.fp7] End If
Recommended Posts
This topic is 6251 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