Externally triggering Thunderbird into displaying a wanted message - scripting

I would like having a way to trigger Thunderbird, from an external script, into displaying a particular message in a particular folder.
If it were Firefox, say, I would use firefox -new-tab http://some-URL, and an already running Firefox (or a new one if none) would nicely fetch and display URL. But I found no way to do something equivalent with Thunderbird, neither on the Thunderbird site or through existing extensions, and even after some furious Googling around, which I attempted more than once!
One problem, compared to a plain URL, is the need some notation for selecting a message. Short of a better solution, I wrote a script which knows folder:SOME-FOLDER:ORDINAL, and behaves like an extension of xdg-open. My tool inserts a proper prefix and a few .sbd as needed within the SOME-FOLDER part to turn it into an absolute Thunderbird file reference, and ORDINAL picks a message in that folder. My tool then grabs the message, heuristically converts it into HTML file, and then, directs a Web browser to the resulting file (and if :ORDINAL is not given, it processes the whole folder instead, yielding an HTML index and many linked messages).
My current tool helps a bit at saving message references in other documents and efficiently retrieving them later, but I handle a copy of the Thunderbird message, and not the original. So if I want to delete it, refile it in another Thunderbird folder, and do other similar operation, I still have to go to Thunderbird, interactively find my way again to the wanted message before I can handle it, and this, is not efficient. What I'm dreaming of is a way to get rid of all my HTML conversion and browser trickery, but still keep the pseudo-URL paradigm and pseudo xdg-open interface, to directly force Thunderbird into the correct folder, with the wanted message correctly displayed.
In previous email readers I used (Emacs RMAIL and then Gnus, and Mutt as well later), such things could be managed, and I heavily used such capabilities in scripts. I am astonished, surprised, even a bit dismayed, by the apparent weakness of Thunderbird as a scriptable mail reader. Am I missing something evident? Any avenue or suggestion?
François
P.S. Of course, I agree that using ORDINAL is not very clever. It might mean a different message if the folder get some messages added or deleted. This is a lesser bad. A better but potentially heavier notation might use Message-ID values, but then, an index would also be needed to find the Thunderbird folder containing each message.

There seems to be some way to do it since Google Desktop supported it according to this thread - http://forums.mozillazine.org/viewtopic.php?f=39&t=584542. Perhaps try installing Google Desktop and see what kind of hyperlink its using?
I'll add Outlook supports using external hyperlinks using the outlook: naming scheme, for example outlook:Inbox or outlook:0000000007A2379547B0624691F4FB2E5468A0D7642E2000. See http://www.davidtan.org/create-hyperlinks-to-outlook-messages-folders-contacts-events/ for more info.

Related

How to go to a folder without specify the path

I am creating a button that will open one directory in your computer (for example: C:\Users\NameOfUser\Downloads) when you click it. But if I do this on another computer or from another user account with a different name the button doesn’t work. I just used Process.Start() for the button.
Is there a different way to do this that will work from any user account?
You can get most folder paths like this just by calling Environment.GetFolderPath() with the right Environment.SpecialFolder enum value. Unfortunately, the Downloads special folder in .Net isn't quite "special" enough and (imo) is unreasonably complicated to get. If you actually need to know the path, the correct way is to follow the accepted answer here:
Getting Downloads Folder in C#?
Even worse, it's written for C# and uses code that's not very easy to translate.
The good news is there's also a NuGet package I'd expect you can use from VB. The even better news is you don't really care about the exact path in this case. You just want to open an Explorer window via Process.Start(). That means you can use this shortcut (also available via the other question):
Process.Start("shell:Downloads")

Opera Next extension autoupdate via update_url

I got problem with my company internal extension. They don't want to publish it, as it does gather data on external server. So I need to host it myself... but would like not to lose ability of autoupdate.
As far as I read I need to use update_url in manifest, but nothing more is said in Opera documentation...
"update_url": "http://path/to/updateInfo.xml", - as it is said in documentation page
Ok... and what should I put in that xml? Will it autoupdate or just notify users about new updates? Where do I put rest of updated files?
I tried to concat Opera itself about this question, but they don't give any contact information except something like if you have problem, ask on stackoverflow... so here I am.
If it does not work, I was thinking about really BAD method, using unsafe-eval and keeping newest version in local storage... but would rather like to avoid that.
In general the behavior is the same as for Chrome. You can base on this document: https://developer.chrome.com/extensions/autoupdate

Persisting VBA/VBScript macro settings

I've created an Outlook (2010) VBScript macro that has some user-configurable settings. I've googled and checked the likely resources and can't figure out a good way to persist them. I'm currently storing them in the body of a mail item! It don't get much kludgier than that!
Should I use the Windows registry? An ini file? Or??? And whether registry, file, or???, what key/folder/??? would I use?
Just before hitting 'Post' on this I tried one more google search and hit on this: http://www.jkp-ads.com/articles/DistributeMacro08.asp.
The gist I took away was, ini file or registry are both kosher. One nice thing about VBA's use of the registry is it automatically puts "app" data in the approved place, just need to give your "app" a key. Since my data is just a big string with parsing code already in place, I used strData = GetSetting(strAppKey, strSection, strLeafKey) and SaveSetting(strAppKey, strSection, strLeafKey, strData) and voila, all is good.
The standard Outlook way of storing settings, especially if they relate to a particular mailbox/store and can be accessed from multiple machines connected to the same mailbox, is to use a hidden message stored in one of the well known folders, such as the Inbox.
The hidden MAPI messages can be accessed using MAPIFolder.GetStorage: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.mapifolder.getstorage.aspx

How do you do real time document tracking?

I was considering diff Document Tracking options and came across DocTracking.com. DocTracking.com allows you to upload documents (PDF Word etc) and adds some kind of invisible tracking to it and returns the document to you which can then be used just like you would use the document otherwise. This tracking tells you when your documents were opened, who opened them (IP), geo-location of opening if they are re-opened or forwarded, what pages were read and how long it was read for, what was printed. Any leads on how this could be done would be appreciated.
It may be possible to embed an internet control/image into the document so get the client application to send an HTTP request to the server, which can use the request to identify the document and link it to the IP address (and consequently location). Various degrees of logic can be embedded for more sophistication.
Of course, the won't work if someone's Word, let's say, is firewalled.
That's one of the ways I can think of to make something like doctracking.com's system work. I doubt that there is anything built into Acrobat or Word to let a document stream data from the host PC, seems massively unsafe.

Refresh browser via cron(or not) to a different page on remote request?

I need to display pages in a tutorial fashion. I looked in to netsupport, beamyourscreen and other possibilities but, I do not want the viewers to download anything. I cannot use gd / send screenshots due to audio / video instructions embedded in some of the pages.
Basically, I need the ability to "refresh" a users browser window to a different page via an interface on my end. Whether via a form submission, javascript or any other type of "controller" that allows me to change the page on the viewers browser. PERL preferred but, PHP / javascript whatever works and is cross browser. I set up a simple javascript page forward timer that "works" but, page load times and conversation interruptions are a huge factor.
The entire tutorial website will be developed around this ability.
I was looking in to curl / cron / wget methods but, found little information.
I have seen forum and chat scripts that basically perform a similar task but, there must be a simple(ish) solution in leau of hacking up another script to suit my needs.
I do not want others to control the pages either. The site really, only needs to be accessable during the tutorial however, It "could" remain web accessable as long as user interaction was normal unless (being controlled).
The initial site concept is based on instructing people how to properly introduce new pets into a home. Will be operated by a veteranarian that saved my pets life. I wanted to give something back.
Possible? I really appreciate simple examples etc...
You have no other way but to keep polling the server for "instructions" using javascript. No, you can't send nothing to the end user browser, neither curl nor wget.
Mainly, you'll have to set up a simple request/response protocol between the browser and the server.
If you want to go deeper, you can use something like cometd/meteord/etc. If not, a hidden iframe that reloads himself and receives pages with javascript code for the needed actions can do the trick.
Another alternative.
With javascript dopolling and single character flatfile. Have a simple one character flatfile with a single var. Write it in perl (it is faster and uses less resources than php). The parent script calls a javascript variable in a flatfile. It hits the flatfile and goes wherever the var sets it. The flatfile is written to by the controller. Done.
I guess you could also rename an empty flatfile and use that as the controller. I am usure which is faster, open and read a specific file or hit the directory and return the file name. On the controller side, opening and writing to a file vs renaming a file. Maybe they counter each other in resources and time?
This way the site can act as a normal site. When you want to have remote users see a "presentation" (automatically being shown the site pages at the controllers pace), the controller activates polling and tells the viewers to push a start button. This allows a remote instructor to load pages for the viewers at his leisure.
It is a simple solution that works with nothing really sophisticated going on. No frames are needed either. Just need javascript enabled.
Any better suggestions are welcome!
It occurred to me that what you might want to use is HTML Push technology. Check out the wiki, they have several links. I have never used it myself