JH Howland Posted September 10, 2017 Posted September 10, 2017 (edited) I have created an "opener" file called "OpenMP" that is located on the Windows Desktop. Also, a global variable for the directory where the FMP14 files are located called "$$marinaDir" = "MarinaPro v17". When activated the launcher opens but does not open the target file using the following file path, "filewin:/C:/$$marinaDir/Marina.fmp12." However if I substitute with the following, "filewin:/C:/MarinaPro v17/Marina.fmp12"; all is good. The script elements follow: #Create variable... Set Variable [$$marinaDir; Value: "MarinaPro v17"] #Start MarinaPro... Open File ["Marina"] (Marina File Path: filewin:/C:/$$marinaDir/Marina.fmp12) What am I missing? Edited September 11, 2017 by JH Howland My bad, Work in FMP11, 14 & 16
bcooney Posted September 10, 2017 Posted September 10, 2017 "filewin:/C:/$$marinaDir/Marina.fp7." is seen as a string and therefore $$marinaDir doesn't change. "filewin:/C:/" & $$marinaDir & "/Marina.fp7"
JH Howland Posted September 10, 2017 Author Posted September 10, 2017 (edited) Doesn't work, creates a File Path entry error. I can change the file path to: filewin:"/C:/" & $$marinaDir & "/Marina.fmp12", however it still does not launch "Marina.fmp12" ? Edited September 11, 2017 by JH Howland My bad, Work in FMP11, 14 & 16
comment Posted September 11, 2017 Posted September 11, 2017 I don't fully follow your description. Are you trying to use a variable in the Manage External Data Sources window?
Ron Cates Posted September 11, 2017 Posted September 11, 2017 You'll want to set the variable to the entire path and then enter just the variable $$marinaDir = "filewin:/C:/MarinaPro v17/Marina.fp7" Open File ["Marina"] (Marina File Path: $$marinaDir )
JH Howland Posted September 11, 2017 Author Posted September 11, 2017 (edited) Doesn't work, creates a File Path entry error. I can change the file path to: "filewin:$$marinaDir" ($$marinaDir = "/C:/MarinaPro v17/Marina.fmp12"), however it still does not launch "Marina.fmp12". File path will only work as "filewin:/C:/MarinaPro v17/Marina.fmp12". Variables in file path should work, but do not for reasons unknown. I cannot even get the Filemaker Help "Examples of using variables in file paths" to work. Edited September 11, 2017 by JH Howland My bad, Work in FMP11, 14 & 16
comment Posted September 11, 2017 Posted September 11, 2017 This thread is weirder than shoes on a snake. Please answer my question above. Also clarify why this is posted in FileMaker Pro 14 section, when your profile shows version 11 and you are trying to open a .fp7 file. This part: On 9/10/2017 at 11:59 PM, JH Howland said: Open File ["Marina"] (Marina File Path: filewin:/C:/$$marinaDir/Marina.fp7) also makes no sense: the Open File [] script step does not have a second part that looks like that.
JH Howland Posted September 11, 2017 Author Posted September 11, 2017 Yes, I think to your question (Filemaker Pro "External Data Sources", then "File Path list" to enter a global variable for a directory name ($$marinaDir) that may be different on different computers as well as a variable for different users ($$winUser), not being discussed here. As stated I cannot get any $variable or $$variable to perform in a "File Path list".
Fitch Posted September 11, 2017 Posted September 11, 2017 According to the examples here: http://www.filemaker.com/help/12/fmp/html/create_db.8.39.html ... your path should work. But -- possibly the slash in front of the drive letter needs to be removed from the variable and added to "filewin:" like so: filewin:/$$MarinaDir ... where $$MarinaDir looks like: C:/MarinaPro v17/Marina.fmp12
comment Posted September 12, 2017 Posted September 12, 2017 You still haven't clarified which version you're using. In any case, support for variables in external data source is a new feature of FileMaker Pro version 16. In previous versions, you cannot use variables when defining a data source. This is mentioned in the help in at least two places: Creating file pathsEditing external FileMaker data sources You could have also seen the difference between the hints listed in the Edit Data Source window: compared to those listed in (for example) in the Specify Output file dialog of the Export Records script step:
JH Howland Posted September 12, 2017 Author Posted September 12, 2017 14 hours ago, Fitch said: According to the examples here: http://www.filemaker.com/help/12/fmp/html/create_db.8.39.html ... your path should work. But -- possibly the slash in front of the drive letter needs to be removed from the variable and added to "filewin:" like so: filewin:/$$MarinaDir ... where $$MarinaDir looks like: C:/MarinaPro v17/Marina.fmp12 Thanks Fitch. I have tried that as well, but no happiness. Thank you Comment. To clarify further, I am in the process of converting an .fp7 solution (MarinaPro Marina Management solution with 18 relational db elements) to an .fmp12 solution. I am using FMP 14 advanced for this purpose. Are you saying that the "Examples of using variables in file paths" in FMP 11 and 14 Help are not able to be utilized within an "External Data Sources -> File Path List? If not, why are file path examples utilizing $variable and $$variable outlined in FMP 11 and 14 help. Obviously I am still missing something here.
rwoods Posted September 12, 2017 Posted September 12, 2017 (edited) I suspect that whilst FM16 can support $$ variables in the 'Specify Output File' dialogue, they cannot be embedded in other strings. If you define $$pathToFile in a script before attempting to open the file, it may work So put Set Variable ( $$pathToFile; "filewin:/C:/" & $$marinaDir & "/Marina.fmp12") in a script before attempting to open the file and in the 'Specify Output File' dialogue box, just put $$pathToFile with nothing else on that line Does that work? Edited September 12, 2017 by rwoods
comment Posted September 12, 2017 Posted September 12, 2017 1 hour ago, JH Howland said: Are you saying that the "Examples of using variables in file paths" in FMP 11 and 14 Help are not able to be utilized within an "External Data Sources -> File Path List? Yes, that is exactly what I am saying. On the same page, you will find this note: Quote • Variables are not supported in FileMaker data sources. For more information on data sources, see Editing external FileMaker data sources. 1 hour ago, JH Howland said: why are file path examples utilizing $variable and $$variable outlined in FMP 11 and 14 help. Because variables can be used in other file paths - for example, in the Export Records [] script step.
rwoods Posted September 12, 2017 Posted September 12, 2017 (edited) Yes indeed, it is a non-starter if not using FM16! PS Does 'non-starter' make any sense outside of the UK? Edited September 12, 2017 by rwoods
LaRetta Posted September 12, 2017 Posted September 12, 2017 18 hours ago, comment said: This thread is weirder than shoes on a snake. Consider this stolen. 1
JH Howland Posted September 12, 2017 Author Posted September 12, 2017 5 hours ago, rwoods said: I suspect that whilst FM16 can support $$ variables in the 'Specify Output File' dialogue, they cannot be embedded in other strings. If you define $$pathToFile in a script before attempting to open the file, it may work So put Set Variable ( $$pathToFile; "filewin:/C:/" & $$marinaDir & "/Marina.fmp12") in a script before attempting to open the file and in the 'Specify Output File' dialogue box, just put $$pathToFile with nothing else on that line Does that work? Yes, it does in FMP 16. No, in FMP 11 and 14 as Mr. Comment has pointed out. I have to admit to not understanding the FMP Help info. with regard to use of file paths with variables.
comment Posted September 12, 2017 Posted September 12, 2017 1 minute ago, JH Howland said: I have to admit to not understanding the FMP Help info. with regard to use of file paths with variables. There are different kinds of file paths. Some of these support the use of variables and some don't. External data sources are the kind that doesn't (until version 16).
Recommended Posts
This topic is 2879 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