Ok, don’t freak out. It’s Lotus Notes time.
In Lotus Notes if someone emails you a link and you click on it, the default browser it opens is Internet Explorer. We want Safari to be launched instead. We had this script that SOMETIMES worked in version 6.5
on run URL
tell application "Safari"
activate
Get URL URL
end tell
end run
Now that we are in version 7, that is not working at all, and instead produces the error message “Unable to launch program.” Also when you go to the setting “Lotus Notes → Preferences → Location Preferences” it defaults to “2” because it is probably looking for IE and it doesn’t find it. Any ideas?
Thank you for your help!
Clobberella
Ok, I know Lotus Notes is stinky. Anyone willing to take it on?
We have Lotus Notes 6.0…
a) Scriptability is basically non-existant because the library is indecipherable and Lotus (technically, the third party that writes Notes for Mac) provides no documented support. I’ve always scripted Notes, when desparate to do so, via UI Scripting.
b) Attempts to change the preference that controls this works…for one session/launch. Once you relaunch Notes it reverts to looking for IE, which of course doesn’t exist on the Mac.
We’d love Notes to launch Firefox ourselves, but gave up on it years ago. I generally hate Microsoft, but I just can’t wait until we switch to Exchange in the next 12 months. 8+ years of Notes is far too much.
Kevin, you are saying everything we have said over here for years! Yes, indecipherable, yes hate Microsoft, yes this has gone on too long. Thanks at least for the validation, maybe this is just a non-solver.
I also forgot to add that even UI Scripting was more difficult than necessary. Even using UI Browser to get proper menu IDs and such didn’t work. I had to resort to ploddingly simple keystroke commends to click and tab around the interface.
An example:
How to get the Body of a Notes e-mail to the clipboard (after the e-mail is opened):
--get data form incoming e-mail
tell application "Notes"
activate
--Notes seems scriptable but I could never figure it out, so resorted to UI scripting
--Thankfully it's default cursor positions are very predictable and handy
tell application "System Events"
tell process "Notes"
--copy existing e-mail contents
keystroke "a" using {command down} --select all text
delay small_delay --give Notes a chance to catch-up
keystroke "c" using {command down} --copy text to clipboard
end tell
end tell
set clipboard_from_Notes to the clipboard
--tuck Notes out of the way visually since this script invokes so many applications
my focusManager("Notes", false)
end tell
To create a new e-mail based on clipboard text:
--paste into pre-prepared Notes reply
tell application "Notes"
activate
tell application "System Events"
tell process "Notes"
delay small_delay --give Notes a chance to be be ready
--create new e-mail
keystroke "m" using {command down}
--insert proper replyto addresss
keystroke "e-mail address here"
--move to cc field and insert proper address
keystroke tab
keystroke "e-mail address here"
--move to Subject line and insert proper title
keystroke tab
keystroke tab
keystroke "Subject Line"
--move to body area and paste response from TextEdit
keystroke tab
delay long_delay --give the system a chance to be be ready
keystroke "v" using {command down} --paste new body
end tell
end tell
end tell
Look like fun? (These are snippets from a larger Notes + FileMaker solution I wrote, so apologies for the undefined handler references.)
I stared at the AppleScript Dictionary again, just for fun, and the problem seems to be that all the human-reable components deal with local databases, but there are no scriptable ways (or no obvious ones) for dealing with databases from the server-side of Notes (like e-mail).
Notes is just not a “normal” Mac application, nor “normal” even by PC standards. As e-mail, it defies logic and doesn’t use any convention I’ve ever seen. I mean, WTF is with the e-mail quoting scheme in Notes?