LingoJango Posted April 3, 2008 Share Posted April 3, 2008 Hi, everyone, I thought I would get a filepath when a file was stored as a reference, but as far as I can tell I just get the filename. Is there any way to open the specific file if it's not a picture, movie or sound? I've tried searching the forums but there's too much chaff. Quote Link to comment Share on other sites More sharing options...
Norma_Snockurs Posted April 3, 2008 Share Posted April 3, 2008 I thought I would get a filepath when a file was stored as a reference, but as far as I can tell I just get the filename. You can use this to get the full file path for a file stored as a reference Let ( source=RightValues ( GetAsText ( <Your Container Field> ) ; 1 ) ; "/" & MiddleWords( source ; 2 ; Length ( source ) ) ) Quote Link to comment Share on other sites More sharing options...
LingoJango Posted April 3, 2008 Author Share Posted April 3, 2008 Nope. That gives me the filename preceded by a slash. GetAsText just gives me the filename. In DataViewer, the field reference by itself just gives me the filename. According to Special Edition Using Filemaker 9, double-clicking on a container field with a file stored as reference should open the referenced file (or, presumably, perform the default action on that file). Not working. Guess I'll have to go another route. Could it be a FM9 bug? Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted April 3, 2008 Share Posted April 3, 2008 GetAsText just gives me the filename. In DataViewer, the field reference by itself just gives me the filename. GetAsText (container field) should give you three separate lines of text when the file (movie, picture, whatever) is stored as a reference. If you're using a field to display the answer (either a calc text field or a plain text field that has been filled in via a script or button-function), make sure the field is vertically DEEP enough to see all 3 lines. If it really does definitely contain ONLY the file name? I don't think those were stored as reference, then. And Norma Snockurs' formula certainly ought to return a file path and not just a slash, so this ismost likely the case. Quote Link to comment Share on other sites More sharing options...
Norma_Snockurs Posted April 3, 2008 Share Posted April 3, 2008 GetAsText (container field) should give you three separate lines of text when the file (movie, picture, whatever) is stored as a reference. I think a clarification is needed - it depends on the type of file being referenced. Yes, if the file is inserted as a movie or picture, GetAsText (container field) will return three values but if the file is inserted purely as a file then only two values are returned - a relative path and the full one. The formula I gave is valid for OS X and Windows and seems to work reliably enough for me. If you're only getting the file name returned then that does suggest the file is not actually being referenced or the reference is failing for some reason. Certainly, in the case of an Excel file inserted in to a container as a reference, double-clicking the file in the container opens the file in Excel. I guess this should work for any file types that are associated to a local application. Have you tried using Go to Field [select/perform; ] as a script step? This should open a referenced file also. Tested in FM Pro Advanced 9.0.3 - OS X.5.2 & FM Pro 9.0.1 - XP Pro SP2. Quote Link to comment Share on other sites More sharing options...
LingoJango Posted April 3, 2008 Author Share Posted April 3, 2008 I'm embarrassed to report that although I had tested this over and over in several records before posting the problem, this time it's working, so I must have neglected to click in the checkbox all the previous times. Hope you guys won't stop replying to my stupid desperate requests for help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.