Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
2 clarified the question
source | link

I am using a simple applescript application to open different URL schemes in different Fluid Apps.

By setting this app as the default browser, I can effectively parse out the URL scheme and open the appropriate stand-alone Fluid App as the browser.

Everything works perfectly, except the "share this folder..." option in Dropbox. This opens a local URL - file:///var/folders/...

This simply does not work. The default_browser application launches and then immediately closes.

Does anyone know how to update this script so that local file links will work?

on open location this_URL

if this_URL contains "docs.google.com" then
    tell application "/Applications/Fluids/Google Drive.app"
        activate
        open location this_URL
    end tell
else if this_URL contains "drive.google.com" then
    tell application "/Applications/Fluids/Google Drive.app"
        activate
        open location this_URL
    end tell
else if this_URL contains "mail.google.com" then
    tell application "/Applications/Fluids/Gmail.app"
        activate
        open location this_URL
    end tell
else if this_URL contains "gmail.com" then
    tell application "/Applications/Fluids/Gmail.app"
        activate
        open location this_URL
    end tell
    -- default browser here
else
    tell application "/Applications/Google Chrome.app"
        activate
        open location this_URL
    end tell
end if
end open location

EDIT: to clarify - the Dropbox "share this folder..." option opens the default browser app (above), which then closes immediately.

I am using a simple applescript application to open different URL schemes in different Fluid Apps.

By setting this app as the default browser, I can effectively parse out the URL scheme and open the appropriate stand-alone Fluid App as the browser.

Everything works perfectly, except the "share this folder..." option in Dropbox. This opens a local URL - file:///var/folders/...

This simply does not work. The default_browser application launches and then immediately closes.

Does anyone know how to update this script so that local file links will work?

on open location this_URL

if this_URL contains "docs.google.com" then
    tell application "/Applications/Fluids/Google Drive.app"
        activate
        open location this_URL
    end tell
else if this_URL contains "drive.google.com" then
    tell application "/Applications/Fluids/Google Drive.app"
        activate
        open location this_URL
    end tell
else if this_URL contains "mail.google.com" then
    tell application "/Applications/Fluids/Gmail.app"
        activate
        open location this_URL
    end tell
else if this_URL contains "gmail.com" then
    tell application "/Applications/Fluids/Gmail.app"
        activate
        open location this_URL
    end tell
    -- default browser here
else
    tell application "/Applications/Google Chrome.app"
        activate
        open location this_URL
    end tell
end if
end open location

I am using a simple applescript application to open different URL schemes in different Fluid Apps.

By setting this app as the default browser, I can effectively parse out the URL scheme and open the appropriate stand-alone Fluid App as the browser.

Everything works perfectly, except the "share this folder..." option in Dropbox. This opens a local URL - file:///var/folders/...

This simply does not work. The default_browser application launches and then immediately closes.

Does anyone know how to update this script so that local file links will work?

on open location this_URL

if this_URL contains "docs.google.com" then
    tell application "/Applications/Fluids/Google Drive.app"
        activate
        open location this_URL
    end tell
else if this_URL contains "drive.google.com" then
    tell application "/Applications/Fluids/Google Drive.app"
        activate
        open location this_URL
    end tell
else if this_URL contains "mail.google.com" then
    tell application "/Applications/Fluids/Gmail.app"
        activate
        open location this_URL
    end tell
else if this_URL contains "gmail.com" then
    tell application "/Applications/Fluids/Gmail.app"
        activate
        open location this_URL
    end tell
    -- default browser here
else
    tell application "/Applications/Google Chrome.app"
        activate
        open location this_URL
    end tell
end if
end open location

EDIT: to clarify - the Dropbox "share this folder..." option opens the default browser app (above), which then closes immediately.

1
source | link

Add local file URL handling to Applescript Application

I am using a simple applescript application to open different URL schemes in different Fluid Apps.

By setting this app as the default browser, I can effectively parse out the URL scheme and open the appropriate stand-alone Fluid App as the browser.

Everything works perfectly, except the "share this folder..." option in Dropbox. This opens a local URL - file:///var/folders/...

This simply does not work. The default_browser application launches and then immediately closes.

Does anyone know how to update this script so that local file links will work?

on open location this_URL

if this_URL contains "docs.google.com" then
    tell application "/Applications/Fluids/Google Drive.app"
        activate
        open location this_URL
    end tell
else if this_URL contains "drive.google.com" then
    tell application "/Applications/Fluids/Google Drive.app"
        activate
        open location this_URL
    end tell
else if this_URL contains "mail.google.com" then
    tell application "/Applications/Fluids/Gmail.app"
        activate
        open location this_URL
    end tell
else if this_URL contains "gmail.com" then
    tell application "/Applications/Fluids/Gmail.app"
        activate
        open location this_URL
    end tell
    -- default browser here
else
    tell application "/Applications/Google Chrome.app"
        activate
        open location this_URL
    end tell
end if
end open location