Matthew F Posted March 9, 2005 Author Posted March 9, 2005 Does anyone know how to run a script which exports data to the users "Desktop"? I'm running Filemaker Server which does not seem to be aware of the path to the users local folders. If I save a file with the path "file:FileName" it ends up in the folder where the local users FileMaker application is located.
Matthew F Posted March 9, 2005 Posted March 9, 2005 Does anyone know how to run a script which exports data to the users "Desktop"? I'm running Filemaker Server which does not seem to be aware of the path to the users local folders. If I save a file with the path "file:FileName" it ends up in the folder where the local users FileMaker application is located.
Matthew F Posted March 9, 2005 Author Posted March 9, 2005 Does anyone know how to run a script which exports data to the users "Desktop"? I'm running Filemaker Server which does not seem to be aware of the path to the users local folders. If I save a file with the path "file:FileName" it ends up in the folder where the local users FileMaker application is located.
Fenton Posted March 9, 2005 Posted March 9, 2005 Exports happen on the client machine. FileMaker will only export to a fixed location. But the user's desktop is not a fixed location, because the short user name is different for everybody. The FileMaker application folder is fixed folder, in a sense, so it's used as a last resort. Another folder which everyone has the same is the Macintosh HD/Users/Shared folder. So you can set an export file reference to there and it should work. You can use AppleScript to move it from there to their desktop, if desired; in a Perform AppleScript step. AppleScript can dynamically get the current user's desktop, simply as "desktop". I've used a similar method to print to PDF. I'm also renaming the file to a field in the database. Don't know if you need that, probably. If so it should be on the current layout, with this simple method; or you could add its specific layout reference. set sharedFolder to "Macintosh HD:Users:Shared:" set printPDF to "Macintosh HD:Users:Shared:Print.pdf" -- this would be the FileMaker Export file reference path --tell application "FileMaker Developer" --commented out in FileMaker tell current record of window 1 set fileName to cell "FileName" end tell set newFile to sharedFolder & fileName tell application "Finder" try set name of file printPDF to fileName move file newFile to the desktop with replacing end try end tell --end tell --comment out also
Fenton Posted March 9, 2005 Posted March 9, 2005 Exports happen on the client machine. FileMaker will only export to a fixed location. But the user's desktop is not a fixed location, because the short user name is different for everybody. The FileMaker application folder is fixed folder, in a sense, so it's used as a last resort. Another folder which everyone has the same is the Macintosh HD/Users/Shared folder. So you can set an export file reference to there and it should work. You can use AppleScript to move it from there to their desktop, if desired; in a Perform AppleScript step. AppleScript can dynamically get the current user's desktop, simply as "desktop". I've used a similar method to print to PDF. I'm also renaming the file to a field in the database. Don't know if you need that, probably. If so it should be on the current layout, with this simple method; or you could add its specific layout reference. set sharedFolder to "Macintosh HD:Users:Shared:" set printPDF to "Macintosh HD:Users:Shared:Print.pdf" -- this would be the FileMaker Export file reference path --tell application "FileMaker Developer" --commented out in FileMaker tell current record of window 1 set fileName to cell "FileName" end tell set newFile to sharedFolder & fileName tell application "Finder" try set name of file printPDF to fileName move file newFile to the desktop with replacing end try end tell --end tell --comment out also
Fenton Posted March 9, 2005 Posted March 9, 2005 Exports happen on the client machine. FileMaker will only export to a fixed location. But the user's desktop is not a fixed location, because the short user name is different for everybody. The FileMaker application folder is fixed folder, in a sense, so it's used as a last resort. Another folder which everyone has the same is the Macintosh HD/Users/Shared folder. So you can set an export file reference to there and it should work. You can use AppleScript to move it from there to their desktop, if desired; in a Perform AppleScript step. AppleScript can dynamically get the current user's desktop, simply as "desktop". I've used a similar method to print to PDF. I'm also renaming the file to a field in the database. Don't know if you need that, probably. If so it should be on the current layout, with this simple method; or you could add its specific layout reference. set sharedFolder to "Macintosh HD:Users:Shared:" set printPDF to "Macintosh HD:Users:Shared:Print.pdf" -- this would be the FileMaker Export file reference path --tell application "FileMaker Developer" --commented out in FileMaker tell current record of window 1 set fileName to cell "FileName" end tell set newFile to sharedFolder & fileName tell application "Finder" try set name of file printPDF to fileName move file newFile to the desktop with replacing end try end tell --end tell --comment out also
Matthew F Posted March 9, 2005 Author Posted March 9, 2005 Thanks, Fenton. That could come in handy. The names of the boot volumes of my client computers vary from one another and are no longer named "Macintosh HD". Is that necessary for your solution?
Matthew F Posted March 9, 2005 Author Posted March 9, 2005 Thanks, Fenton. That could come in handy. The names of the boot volumes of my client computers vary from one another and are no longer named "Macintosh HD". Is that necessary for your solution?
Matthew F Posted March 9, 2005 Author Posted March 9, 2005 Thanks, Fenton. That could come in handy. The names of the boot volumes of my client computers vary from one another and are no longer named "Macintosh HD". Is that necessary for your solution?
Fenton Posted March 9, 2005 Posted March 9, 2005 The fixed file paths are not a problem for AppleScript. It can easily get: path to startup disk path to "sdat" -- Shared folder It is FileMaker which requires a fixed file path in its Export script step. I suppose it would be possible to put multiple file paths in there, with returns between. I've haven't tried this, and I'm not sure how it would work in an Export step, but theoretically it should. Basically it would be a lot better if people would restrain themselves from renaming their hardrives if they want to use FileMaker in this way. You could also revert to your original plan. Assume that the Export will fail to find a location, then go get the file from the FileMaker application folder. AppleScript can also find that location (assuming they only have 1 copy of a FileMaker 7 application): tell application "Finder" to set FM_folder to container of (application file id "FMP7") as string A possible glitch with this would be if the user did not have permissions for that folder. But it sounds like they do, if they're doing things like changing their hard drive name. [i developed the fixed path method for a "print to PDF" operation. It will not create the file in the FileMaker application folder if the path is unavailable. It will give you an "out of memory" error.]
Fenton Posted March 9, 2005 Posted March 9, 2005 The fixed file paths are not a problem for AppleScript. It can easily get: path to startup disk path to "sdat" -- Shared folder It is FileMaker which requires a fixed file path in its Export script step. I suppose it would be possible to put multiple file paths in there, with returns between. I've haven't tried this, and I'm not sure how it would work in an Export step, but theoretically it should. Basically it would be a lot better if people would restrain themselves from renaming their hardrives if they want to use FileMaker in this way. You could also revert to your original plan. Assume that the Export will fail to find a location, then go get the file from the FileMaker application folder. AppleScript can also find that location (assuming they only have 1 copy of a FileMaker 7 application): tell application "Finder" to set FM_folder to container of (application file id "FMP7") as string A possible glitch with this would be if the user did not have permissions for that folder. But it sounds like they do, if they're doing things like changing their hard drive name. [i developed the fixed path method for a "print to PDF" operation. It will not create the file in the FileMaker application folder if the path is unavailable. It will give you an "out of memory" error.]
Fenton Posted March 9, 2005 Posted March 9, 2005 The fixed file paths are not a problem for AppleScript. It can easily get: path to startup disk path to "sdat" -- Shared folder It is FileMaker which requires a fixed file path in its Export script step. I suppose it would be possible to put multiple file paths in there, with returns between. I've haven't tried this, and I'm not sure how it would work in an Export step, but theoretically it should. Basically it would be a lot better if people would restrain themselves from renaming their hardrives if they want to use FileMaker in this way. You could also revert to your original plan. Assume that the Export will fail to find a location, then go get the file from the FileMaker application folder. AppleScript can also find that location (assuming they only have 1 copy of a FileMaker 7 application): tell application "Finder" to set FM_folder to container of (application file id "FMP7") as string A possible glitch with this would be if the user did not have permissions for that folder. But it sounds like they do, if they're doing things like changing their hard drive name. [i developed the fixed path method for a "print to PDF" operation. It will not create the file in the FileMaker application folder if the path is unavailable. It will give you an "out of memory" error.]
Recommended Posts
This topic is 7203 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