Returning default pdf reader (was: Returning default browser)
Returning default pdf reader (was: Returning default browser)
- Subject: Returning default pdf reader (was: Returning default browser)
- From: Jay Louvion <email@hidden>
- Date: Sat, 13 Jan 2007 20:29:29 +0100
- Thread-topic: Returning default pdf reader (was: Returning default browser)
Title: Returning default pdf reader (was: Returning default browser)
Cordialement,
j.
Jay Louvion
Studio Casagrande
3, rue Müller-Brun
1208 Geneva
T+4122 840 3272
F+4122 840 3271
skypeme:
jaylouvion
www.studiocasagrande.com
Browsing the archive, I found this piece of code
set x to ("" & (path to preferences) & "Internet Preferences")
try
set fileRef to open for access file x
repeat
read fileRef until "q"
set qNext to read fileRef for 2
if qNext is ":x" then exit repeat
end repeat
read fileRef until return
read fileRef until "H"
set browserClient to (items 5 thru 8 of (read fileRef until return)) as string
read fileRef until return
read fileRef until "H"
set mailClient to (items 5 thru 8 of (read fileRef until return)) as string
close access fileRef
on error
close access fileRef
end try
{browserClient, mailClient}
That doesn’t return anything in my case. Is there a simpler way of returning the default web browser that open location and check the frontmost app’s name (that just so clumsy) ?
In the meantime, I found this handy piece of work on applediscussions:
set DefaultBrowser to (word -4 of (do shell script "defaults read com.apple.LaunchServices | grep 'LSHandlerURLScheme = http;'"))
Works fine. Any ideas now how to get the same thing for the defaut app that will open a pdf file ?
Thanks in advance !
Best,
j.
Jay Louvion
Studio Casagrande
3, rue Müller-Brun
1208 Geneva
T+4122 840 3272
F+4122 840 3271
skypeme:
jaylouvion
www.studiocasagrande.com
P Please consider the environment before printing this email.
------ End of Forwarded Message
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden