Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / June 2007



Tip: Looking for answers? Try searching our database.

How do I get the URL in an application that is associated with an URLScheme?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Karl Syvert Løland - 20 Jun 2007 14:01 GMT
Hi :)

I have a little problem here and just have to ask if anyone can help me
with this problem.

I have made an application in cocoa and added the following to it's
info.plist file:
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>Automounter</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>smb</string>
        </array>
    </dict>
</array>

The basis of this application is that it generates a applescript that
mounts up an samba share and opens the file in the url for me. (for use
in a local network etc.) So when I call
smb://<ip>/share/folder/file.type in an browser my program activates and
mounts the share for me and opens that file.

I have tested this with register camino:// with the camino application
and this works.

But How do camino snatch the url from the other browser i originally
wrote it in? (eg. firefox or safari) I initially thought it was sent as
an parameter and build my application on that assumption. But when I
printed all parameters I got there were only the two usual ones, and no url.

How do I get this URL in my application like camino (and some other
applications) do?

Mvh
Karl Syvert Løland
matt neuburg - 20 Jun 2007 14:14 GMT
> Hi :)
>
[quoted text clipped - 30 lines]
> How do I get this URL in my application like camino (and some other
> applications) do?

You get an Apple event, and you parse it.

<http://developer.apple.com/documentation/Carbon/Conceptual/LaunchServic
esConcepts/LSCConcepts/chapter_2_section_6.html>

m.

Signature

matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/
Tiger - http://www.takecontrolbooks.com/tiger-customizing.html
AppleScript - http://www.amazon.com/gp/product/0596102119
Read TidBITS! It's free and smart. http://www.tidbits.com

Karl Syvert Løland - 20 Jun 2007 16:05 GMT
> You get an Apple event, and you parse it.
>
> <http://developer.apple.com/documentation/Carbon/Conceptual/LaunchServic
> esConcepts/LSCConcepts/chapter_2_section_6.html>
>
> m.

Thanks! I solved it using events.

Mvh
Karl Syvert Løland
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.