Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Importing a file downloaded by a web viewer


This topic is 5162 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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.

Posted

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.

  • Newbies
Posted

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

This topic is 5162 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.