1 of 1 people found this helpful
Export Field Contents could be useful.
Define a variable $Path as Get ( TemporaryPath ) & "SomeFileName.pdf"
Then export from the PDF container to $Path and specify to open to document.
"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies." — C.A.R. Hoare, The 1980 ACM Turing Award Lecture
When I read your question my thought is that you need some code to link it with FileMaker. Your google drive is actually stored on your desktop. Not in the cloud. If it is on your desktop then why not create a container in FileMaker specifying external storage. FileMaker should see it just as another folder.
Here's some interesting info:
This is from a referenced PDF file in Google Drive:
The first is the typcial display when you show the PDF Container Field in list view.
The Second is using a Menu Bar Button and in the text area with the pencil where you enter a title for the button I used the Container Field instead. The black area below shows how the filepath is displayed.
The third is a calculated field using getcontainerattributes(PDFFIELD;"All")
Unfortunately while FileMaker stores the filepath for referenced files it does not in this instance let us access that. This is typical... Hopefully they have added that and I just don't know where to get it.
If you use one of a several plugins you can get the referenced path when you insert it into the container field. I think Troi and Monkeybread do this. I know I used somebody's plugin to do this a year or two ago. I think I may have been able to get the two file paths shown above using a plugin.
YOu can also use GetDirectory to locate a folder and save its path into a field or variable. But plugins offer more power when it comes to getting filenames inside folders.
Get ( DocumentsPathListing ) is a nasty little thing that can be used to grab the paths and names of all of the documents in your documents folder. Unfortunately a shortcut of a folder in a cloud folder doesn't work very well here.
From what I can tell you are in the cloud not actually on the Mac. Maybe one of the plugins would solve the problem. If not then create a folder on your real desktop and have FileMaker access it. Set the folder to back up to Google Drive. Be glad to learn if I am not see something.
Are you on a Mac or Windows computer? I haven't used Google Drive, but does it sync files like DropBox where there is a sync folder on your computer and a matching folder in the cloud? Also, if I understand your question, files in Google Drive are available, but you can't see the files in your FMP database.
First, you shouldn't host databases in a sync directory list Google Drive, DropBox, etc.. You will run into trouble at some point where the data will break or worse.
In a number of our solutions, the client has a DropBox folder set up for all manner of files (documents, spreadsheets, etc.). We then create a path in the database (ours are hosted with FileMaker Server, but it could be a local file). Then just Export Field Contents (container field). Set to Open would automatically open the file in the appropriate program. Alternatively, we leverage the path and the filename to automatically open the document in Preview. I think this would be more to your liking since you would have the filename with the associated key words, etc. When setting a path to open the document, I would recommend using the computers TemporaryDirectory so the desktop doesn't become cluttered and the files are automatically cleaned up when the user logs off the computer.
Back to the original question:
I think you are saying you have PDF files stored inside your Filemaker container and want to save that file you a folder in your Google drive. Now you want to open the files in the Google Drive folder using a FileMaker script/button.
Since you can't depend upon your Google Drive files matching where you first put them. the safest bet is to open the file that is inside the container.
If you want to open the exported file for editing and modifying, you might check several plugins one from MBS and one I think it is called Script that enable editing of the data in the PDF while it is in the container field.
You can get reference with
GetContainerAttribute ( container ; "externalFiles" )