December 11, 200718 yr 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, 200718 yr by Guest Tried to simplify question.
December 11, 200718 yr 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 )
December 11, 200718 yr Author 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)
December 11, 200718 yr 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.
December 11, 200718 yr 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.
December 11, 200718 yr Author 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.
December 11, 200718 yr 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, 200718 yr by Guest
December 11, 200718 yr "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"
December 11, 200718 yr Author 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, 200718 yr by Guest
December 12, 200718 yr If[0] Else If[$$fileName = JoeBob.fp7] Open File[JoeBob.fp7] Else If[$$filename = JerryLee.fp7] Open File [JerryLee.fp7] End If
Create an account or sign in to comment