October 14, 201015 yr Newbies Hello, I want to import a CSV file downloaded by a Web Viewer in a script. How can I determinate the file path and the file name? This will be a multi-user solution with Mac clients.
October 15, 201015 yr I believe current versions of Safari send downloads to 'Downloads' folder, but users can change this in Safari. You may prefer to use 360Works ScriptMaster plugin to download the file, as this will allow you to control where it is stored. This way, it could go to temporary folder, and after importing it, you could delete it. As for the filename (without path), that can be parsed out of the HTML.
October 17, 201015 yr Author Newbies The solution, it took me a week to solve: -) The web viewer use the com.apple.internetconfig.plist preference to determinate the download folder, this is an obsolete method, Apple removed the Internet preference pane in Mac OS 10.3. (http://help.filemaker.com/app/answers/detail/a_id/6162/~/filemaker-pro-or-advanced-8.5-crashes-when-viewing-a-web-viewer-object) Now I can use this AppleScript to parse out the path: set kimenet to (do shell script "/usr/libexec/PlistBuddy -c "Print :Version 2.5.4:ic-added:DownloadFolder:ic-data" ~/Library/Preferences/com.apple.internetconfig.plist") as text set kim1 to (offset of ":U" in kimenet) + 1 set kim2 to (offset of "" in kimenet) - 2 set kim3 to text kim1 thru kim2 of kimenet
Create an account or sign in to comment