![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I've tried to find the answer to this myself but haven't had any luck, so once again I turn to the group. Basically the database I have created is a task manager. When the employee finishes their task they save out a file. I need to be able to place a reference to this file (i.e. the file path) into the database. What I would like to be able to do is have a text field called "filePath" with a Browse button next to it. The user clicks the button, navigates to their file, chooses it, and the path to that file is saved in the database. I don't need an actual link to the file or anything, just the path to the file converted to text and placed in the field. Any suggestions on how to go about this? Thanks in advance! -- "Giving money and power to government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke |
#3
| |||
| |||
|
|
Milt, You don't say what kind of file they save out, or what means you use to do that. If it is, for example, "Export field contents..." under user control, you won't automatically be able to learn what name they gave the file. There is no Get(LastUserExportFileName) function. You could save the file under predetermined means, for example by Get(DocumentsPath) to determine the user's documents directory, then appending your file name. Once you build the file name for export, you could of course save that path in any field. A problem with the second method is that a user can always delete or move whatever file they've exported, so the saved path in your database file would be not very useful. You might want to consider: 1) building the output path name 2) exporting the file to this predetermined location 3) importing the file into a FileMaker field 4) [optionally] storing the path of the original export. --- "Giving FileMaker tips to newbies is like giving automatic weapons to infants." -Bill Marriott ![]() "This Being Milt" <thisbeingmilt (AT) gmail (DOT) com> wrote in message news:2005120713154716807%thisbeingmilt (AT) gmailcom (DOT) .. I've tried to find the answer to this myself but haven't had any luck, so once again I turn to the group. Basically the database I have created is a task manager. When the employee finishes their task they save out a file. I need to be able to place a reference to this file (i.e. the file path) into the database. What I would like to be able to do is have a text field called "filePath" with a Browse button next to it. The user clicks the button, navigates to their file, chooses it, and the path to that file is saved in the database. I don't need an actual link to the file or anything, just the path to the file converted to text and placed in the field. Any suggestions on how to go about this? Thanks in advance! -- "Giving money and power to government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke |
#4
| |||
| |||
|
|
Hi Bill, thanks for your help. The file they save out is a proprietary file using some software we have developed in-house. The files are stored on our server. What I want to do is to be able to store in the database the path to this file from the root level of the server. This way when someone says "Hey, where's that file?" I have a reference link. Right now I've been manually entering these paths by copying the path from a terminal window. I have a little button next to the filePath field that copies its contents into the clipboard. This way a few days from now when someone emails me and asks me where a particular file is I simply go to the appropriate record, click the button, and I can paste the complete file path into an email. All I really need to do is to be able to browse to a file (or to a folder) and have the path returned as a text value. /server/directory/directory/directory/filename.xxx Is this possible? On 2005-12-07 14:31:23 -0800, "Bill Marriott" <wjm (AT) wjm (DOT) org> said: Milt, You don't say what kind of file they save out, or what means you use to do that. If it is, for example, "Export field contents..." under user control, you won't automatically be able to learn what name they gave the file. There is no Get(LastUserExportFileName) function. You could save the file under predetermined means, for example by Get(DocumentsPath) to determine the user's documents directory, then appending your file name. Once you build the file name for export, you could of course save that path in any field. A problem with the second method is that a user can always delete or move whatever file they've exported, so the saved path in your database file would be not very useful. You might want to consider: 1) building the output path name 2) exporting the file to this predetermined location 3) importing the file into a FileMaker field 4) [optionally] storing the path of the original export. --- "Giving FileMaker tips to newbies is like giving automatic weapons to infants." -Bill Marriott ![]() "This Being Milt" <thisbeingmilt (AT) gmail (DOT) com> wrote in message news:2005120713154716807%thisbeingmilt (AT) gmailcom (DOT) .. I've tried to find the answer to this myself but haven't had any luck, so once again I turn to the group. Basically the database I have created is a task manager. When the employee finishes their task they save out a file. I need to be able to place a reference to this file (i.e. the file path) into the database. What I would like to be able to do is have a text field called "filePath" with a Browse button next to it. The user clicks the button, navigates to their file, chooses it, and the path to that file is saved in the database. I don't need an actual link to the file or anything, just the path to the file converted to text and placed in the field. Any suggestions on how to go about this? Thanks in advance! -- "Giving money and power to government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke -- "Giving money and power to government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke |
#5
| |||
| |||
|
|
Yes. 1) Create a container field, "c" 2) Create a script with the step: Insert File[Reference; YourTable::c] 3) Create a field, "MyFilePath" (calculation, text result) = Let ( [ FullURL = RightValues ( c; 1) ; OSPrefix="filewin:"; dDelimA = "/"; dDelimB = "\\" ]; Substitute(Right(FullURL;Length(FullURL) - Length(OSPrefix)); dDelimA ; dDelimB ) ) Now, when you run this script step, the user will be prompted to locate a file. They navigate to the file on your server. After they select the file and click "open," a reference is stored in container field c. The reference looks like this, internal to "c": file:MyServerFile.xyz filewin://Server/Volume/Directory/MyServerFile.xyz (FileMaker shows the document icon, or image, or media file in Browse mode, but has the text version of it stored as well, accessible to formulas. The full path is only available when the file is stores as a "reference.") The calculation in MyFilePath just strips out the beginning "filewin:" business and converts the "/" to "\" so it's appropriate for pasting into the address bar of any Windows Explorer or IE window. You'll want to adjust that formula if you are not running in an all-Windows environment. The result of the MyFilePath is: \\Server\Volume\Directory\MyServerFile.xyz Bill "This Being Milt" <thisbeingmilt (AT) gmail (DOT) com> wrote in message news:2005120715232516807%thisbeingmilt (AT) gmailcom (DOT) .. Hi Bill, thanks for your help. The file they save out is a proprietary file using some software we have developed in-house. The files are stored on our server. What I want to do is to be able to store in the database the path to this file from the root level of the server. This way when someone says "Hey, where's that file?" I have a reference link. Right now I've been manually entering these paths by copying the path from a terminal window. I have a little button next to the filePath field that copies its contents into the clipboard. This way a few days from now when someone emails me and asks me where a particular file is I simply go to the appropriate record, click the button, and I can paste the complete file path into an email. All I really need to do is to be able to browse to a file (or to a folder) and have the path returned as a text value. /server/directory/directory/directory/filename.xxx Is this possible? On 2005-12-07 14:31:23 -0800, "Bill Marriott" <wjm (AT) wjm (DOT) org> said: Milt, You don't say what kind of file they save out, or what means you use to do that. If it is, for example, "Export field contents..." under user control, you won't automatically be able to learn what name they gave the file. There is no Get(LastUserExportFileName) function. You could save the file under predetermined means, for example by Get(DocumentsPath) to determine the user's documents directory, then appending your file name. Once you build the file name for export, you could of course save that path in any field. A problem with the second method is that a user can always delete or move whatever file they've exported, so the saved path in your database file would be not very useful. You might want to consider: 1) building the output path name 2) exporting the file to this predetermined location 3) importing the file into a FileMaker field 4) [optionally] storing the path of the original export. --- "Giving FileMaker tips to newbies is like giving automatic weapons to infants." -Bill Marriott ![]() "This Being Milt" <thisbeingmilt (AT) gmail (DOT) com> wrote in message news:2005120713154716807%thisbeingmilt (AT) gmailcom (DOT) .. I've tried to find the answer to this myself but haven't had any luck, so once again I turn to the group. Basically the database I have created is a task manager. When the employee finishes their task they save out a file. I need to be able to place a reference to this file (i.e. the file path) into the database. What I would like to be able to do is have a text field called "filePath" with a Browse button next to it. The user clicks the button, navigates to their file, chooses it, and the path to that file is saved in the database. I don't need an actual link to the file or anything, just the path to the file converted to text and placed in the field. Any suggestions on how to go about this? Thanks in advance! -- "Giving money and power to government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke -- "Giving money and power to government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke |
#6
| |||
| |||
|
|
Hi Bill. When I recreate your calculation below I get an error where the FullURL in the substitute function is highlighted and FMP tells me that the field cannnot be found. On 2005-12-07 16:11:58 -0800, "Bill Marriott" <wjm (AT) wjm (DOT) org> said: Yes. 1) Create a container field, "c" 2) Create a script with the step: Insert File[Reference; YourTable::c] 3) Create a field, "MyFilePath" (calculation, text result) = Let ( [ FullURL = RightValues ( c; 1) ; OSPrefix="filewin:"; dDelimA = "/"; dDelimB = "\\" ]; Substitute(Right(FullURL;Length(FullURL) - Length(OSPrefix)); dDelimA ; dDelimB ) ) Now, when you run this script step, the user will be prompted to locate a file. They navigate to the file on your server. After they select the file and click "open," a reference is stored in container field c. The reference looks like this, internal to "c": file:MyServerFile.xyz filewin://Server/Volume/Directory/MyServerFile.xyz (FileMaker shows the document icon, or image, or media file in Browse mode, but has the text version of it stored as well, accessible to formulas. The full path is only available when the file is stores as a "reference.") The calculation in MyFilePath just strips out the beginning "filewin:" business and converts the "/" to "\" so it's appropriate for pasting into the address bar of any Windows Explorer or IE window. You'll want to adjust that formula if you are not running in an all-Windows environment. The result of the MyFilePath is: \\Server\Volume\Directory\MyServerFile.xyz Bill "This Being Milt" <thisbeingmilt (AT) gmail (DOT) com> wrote in message news:2005120715232516807%thisbeingmilt (AT) gmailcom (DOT) .. Hi Bill, thanks for your help. The file they save out is a proprietary file using some software we have developed in-house. The files are stored on our server. What I want to do is to be able to store in the database the path to this file from the root level of the server. This way when someone says "Hey, where's that file?" I have a reference link. Right now I've been manually entering these paths by copying the path from a terminal window. I have a little button next to the filePath field that copies its contents into the clipboard. This way a few days from now when someone emails me and asks me where a particular file is I simply go to the appropriate record, click the button, and I can paste the complete file path into an email. All I really need to do is to be able to browse to a file (or to a folder) and have the path returned as a text value. /server/directory/directory/directory/filename.xxx Is this possible? On 2005-12-07 14:31:23 -0800, "Bill Marriott" <wjm (AT) wjm (DOT) org> said: Milt, You don't say what kind of file they save out, or what means you use to do that. If it is, for example, "Export field contents..." under user control, you won't automatically be able to learn what name they gave the file. There is no Get(LastUserExportFileName) function. You could save the file under predetermined means, for example by Get(DocumentsPath) to determine the user's documents directory, then appending your file name. Once you build the file name for export, you could of course save that path in any field. A problem with the second method is that a user can always delete or move whatever file they've exported, so the saved path in your database file would be not very useful. You might want to consider: 1) building the output path name 2) exporting the file to this predetermined location 3) importing the file into a FileMaker field 4) [optionally] storing the path of the original export. --- "Giving FileMaker tips to newbies is like giving automatic weapons to infants." -Bill Marriott ![]() "This Being Milt" <thisbeingmilt (AT) gmail (DOT) com> wrote in message news:2005120713154716807%thisbeingmilt (AT) gmailcom (DOT) .. I've tried to find the answer to this myself but haven't had any luck, so once again I turn to the group. Basically the database I have created is a task manager. When the employee finishes their task they save out a file. I need to be able to place a reference to this file (i.e. the file path) into the database. What I would like to be able to do is have a text field called "filePath" with a Browse button next to it. The user clicks the button, navigates to their file, chooses it, and the path to that file is saved in the database. I don't need an actual link to the file or anything, just the path to the file converted to text and placed in the field. Any suggestions on how to go about this? Thanks in advance! -- "Giving money and power to government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke -- "Giving money and power to government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke -- "Giving money and power to government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke |
#7
| |||
| |||
|
|
You are using FM7 or FM8 right? You probably have a typo in there. 1) Copy and paste everything in my original message from the "Let" to the ending ")" (alone by itself). I just did the same to double-check, and it works. - Don't add a semicolon to the end of the line starting with dDelimB - The brackets "[" and "]" are required - Did you think I made a mistake by using "\\" instead of "\"? I didn't. the "\\" is required because within a string, \ is an "escape" character that enables you to include a quote inside a quote. So inside calcs, \" means " and \\ means \. 2) If, for some reason, your newsgroup server/newsgroup reader is mangling the readable version, here is a more compact form. Use everything between the blank lines: Let([FullURL=RightValues(c;1);OSPrefix="filewin:"; dDelimA="/";dDelimB="\\"]; Substitute(Right(FullURL;Length(FullURL)- Length(OSPrefix));dDelimA;dDelimB)) The Let() function is a little weird to understand at first, but here is what it does: You could easily say in a formula: 2 + 7 + 13 to get a result of 22. Alternately you could say, in "English" a = 2 b = 7 c = 13 a + b + c The Let() function enables you to use variable names (within the current calculation) like this without creating separate fields for them. Let ([ a = 2; b = 7; c = 13 ]; a + b + c ) It just requires some extra "punctuation," specifically: - "Let(" to mark the beginning of the function - "[" to mark the beginning of the variables list - ";" to indicate the end of a variable/value pair (except the last pair!) - "];" to mark the end of the variable declarations, and the beginning of the calculation that uses them - ")" to mark the very end of the Let function You probably wouldn't use Let() when you are using simple values like 2, 7, and 12. But when a component of your calculation is long and complicated and you have to use that component more than once, Let() dramatically assists in readability and processing speed. In this case, I used Let() so that you could see more clearly how I am slicing up the values stored in "c" and also so that you could modify this to handle cross-platform stuff later on. Without using Let() the function looks like: Substitute(Right(RightValues(c;1);Length(RightValu es(c;1))- Length("filewin:"));"/";"\\") Good luck. Bill "This Being Milt" <thisbeingmilt (AT) gmail (DOT) com> wrote in message news:2005120717080616807%thisbeingmilt (AT) gmailcom (DOT) .. Hi Bill. When I recreate your calculation below I get an error where the FullURL in the substitute function is highlighted and FMP tells me that the field cannnot be found. On 2005-12-07 16:11:58 -0800, "Bill Marriott" <wjm (AT) wjm (DOT) org> said: Yes. 1) Create a container field, "c" 2) Create a script with the step: Insert File[Reference; YourTable::c] 3) Create a field, "MyFilePath" (calculation, text result) = Let ( [ FullURL = RightValues ( c; 1) ; OSPrefix="filewin:"; dDelimA = "/"; dDelimB = "\\" ]; Substitute(Right(FullURL;Length(FullURL) - Length(OSPrefix)); dDelimA ; dDelimB ) ) Now, when you run this script step, the user will be prompted to locate a file. They navigate to the file on your server. After they select the file and click "open," a reference is stored in container field c. The reference looks like this, internal to "c": file:MyServerFile.xyz filewin://Server/Volume/Directory/MyServerFile.xyz (FileMaker shows the document icon, or image, or media file in Browse mode, but has the text version of it stored as well, accessible to formulas. The full path is only available when the file is stores as a "reference.") The calculation in MyFilePath just strips out the beginning "filewin:" business and converts the "/" to "\" so it's appropriate for pasting into the address bar of any Windows Explorer or IE window. You'll want to adjust that formula if you are not running in an all-Windows environment. The result of the MyFilePath is: \\Server\Volume\Directory\MyServerFile.xyz Bill "This Being Milt" <thisbeingmilt (AT) gmail (DOT) com> wrote in message news:2005120715232516807%thisbeingmilt (AT) gmailcom (DOT) .. Hi Bill, thanks for your help. The file they save out is a proprietary file using some software we have developed in-house. The files are stored on our server. What I want to do is to be able to store in the database the path to this file from the root level of the server. This way when someone says "Hey, where's that file?" I have a reference link. Right now I've been manually entering these paths by copying the path from a terminal window. I have a little button next to the filePath field that copies its contents into the clipboard. This way a few days from now when someone emails me and asks me where a particular file is I simply go to the appropriate record, click the button, and I can paste the complete file path into an email. All I really need to do is to be able to browse to a file (or to a folder) and have the path returned as a text value. /server/directory/directory/directory/filename.xxx Is this possible? On 2005-12-07 14:31:23 -0800, "Bill Marriott" <wjm (AT) wjm (DOT) org> said: Milt, You don't say what kind of file they save out, or what means you use to do that. If it is, for example, "Export field contents..." under user control, you won't automatically be able to learn what name they gave the file. There is no Get(LastUserExportFileName) function. You could save the file under predetermined means, for example by Get(DocumentsPath) to determine the user's documents directory, then appending your file name. Once you build the file name for export, you could of course save that path in any field. A problem with the second method is that a user can always delete or move whatever file they've exported, so the saved path in your database file would be not very useful. You might want to consider: 1) building the output path name 2) exporting the file to this predetermined location 3) importing the file into a FileMaker field 4) [optionally] storing the path of the original export. --- "Giving FileMaker tips to newbies is like giving automatic weapons to infants." -Bill Marriott ![]() "This Being Milt" <thisbeingmilt (AT) gmail (DOT) com> wrote in message news:2005120713154716807%thisbeingmilt (AT) gmailcom (DOT) .. I've tried to find the answer to this myself but haven't had any luck, so once again I turn to the group. Basically the database I have created is a task manager. When the employee finishes their task they save out a file. I need to be able to place a reference to this file (i.e. the file path) into the database. What I would like to be able to do is have a text field called "filePath" with a Browse button next to it. The user clicks the button, navigates to their file, chooses it, and the path to that file is saved in the database. I don't need an actual link to the file or anything, just the path to the file converted to text and placed in the field. Any suggestions on how to go about this? Thanks in advance! -- "Giving money and power to government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke -- "Giving money and power to government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke -- "Giving money and power to government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke |
![]() |
| Thread Tools | |
| Display Modes | |
| |