AnsweredAssumed Answered

Script command Open File using variable

Question asked by alip on Jun 21, 2016
Latest reply on Nov 9, 2016 by alecgregory

Hello all,


Apologies if this is straightforward to all FM whizzes but I'm relatively new to scripting and have not been able to find a solution to my problem. Can any kind sole help?


I have a script which includes opening a file e.g. "FILE_1" which I've saved to the desktop. I have set a variable as follows:

“Set variable  [ $Path ; Value ; Get (DesktopPath) & “FILE_1”]

I know this works as I have used it within a "Show Custom Dialogue" entry.

I then use the Open File command and go to "Specify", then "Manage Data Sources" and finally add "New", in which I add "file:$Path".

However, when I run the script, it is not able to find the file and instead asks me to manually select the file which is sat on the desktop which results in "file:../File_1" being stored within the Data Source entry.


Is it not possible to use a set variable to determine where the file will be, being that it will always be on the desktop? I would prefer to use a variable as some users will use this solution on a mac and others on windows, and will hence have different file paths.


I'd be so grateful if anyone has any advice regarding this problem. Many thanks.