log: learnings & developments
Friday, 20. November 2009, 17:28:47
2009
- Dec 1-3: two-page split-screen function, and several surprises associated with it.
- Nov 28: javascript Pagelaunch from text URL; fixes macro flaws, settings-indpendent.
- Nov 23: finicky local-file panel icons explained: URL in bookmark and IDX file must agree in case.
- Nov 23: PrintNote button for Notes panel toolbar (buttons post)
- Nov 20: Link grabber: macros to capture links as links (in BBCode, HTML or text).
- Nov 16: style-marked button-installer tags implemented (discussion here).
- Nov 15: New-Window option added to Back/Forward buttons; button help demo
- Nov 14: Contacts panel is part of mail system (noob-unobvious critical fact).
- Nov 10: quirk: mail subfilters don't work unless senseless "mark as filtered" is checked.
- Nov 7: to have phrase/wordset address-field searches now, must set up second Google search.
- Nov 7: bad news for dialog.ini hackers: the file is not the whole story.
- Nov 7: a (reliable, non-GUI) way to launch specific sessions.
- Nov 7: quick-start utility for "resume from last time" users (rename&swap method).
- Nov 6: set WIN filetype to open with Opera. Then a link to autosave.win always resumes - even if startup setting is "open with home page."
- Oct 24: view mail files within the browser
2008
- Aug 24 multiword search: phrase, if no "g"; wordset with the "g". Big difference. Lost in Opera 10: now both are wordset.
- Aug 20 how to transcribe your notes file into normal text: open all folders, select all, copy, paste.
- Aug 15: you can save button installers as bookmarks: unlimited, sortable, annotatable storage. Drag to toolbar installs button. Throw buttons away freely - you have a master copy, can re-install in a jiffy. Easy technique / macro displays them all when wanted.
- Aug 15: Windows panel header is a sort-order toggle (I just noticed).
- Aug 15: how to do a quick blog backup
- Aug 4: popups in forum posts: the ABBR tag (Pesala has them in his sig now!)
- icon assignment: taming the IDX file
- localhost.idx: one file for all local-file icons.
2009-12-1: 2-page split screen and... weirdness
You probably have to be an Opera hacker to feel that this is weird. Anyhow: when Opera variables (including %u - URL of current page, %t - defined text, and %c - clipboard contents) are present in a javascript command or a data URL, and it is launched by a GoToPage command with 0 as second parameter, Opera will swap in the value of the variable; while if the parameter is 1, the variable name will be used. Here's a demo: clicking this link launches a data URL with this content:
data:text/html,The URL is %u, and clipboard contents are %C.The default interpretation is parameter=1, so the the variables won't be replaced by their values. And here are buttons that launch the same URL: one with a null parameter:Demo,0 and one with parameter=1: Demo,1.
This provides a way to make a split-tab button combining two pages: Opera commands can store URL to clipboard & close page; then javascript can access the clipboard (as well as current URL) to assemble a frameset-page command. Edit: actually javascript variables are now persistent, which eliminates the problem this solved. You could just store one URL, leave javascript to close the page, then start javascript again and call up that URL. Oh well... Frameset pages have a draggable divider, which makes them handy for things like watching livestreams of sports while chatting on a fan forum - less fussy than restoring and resizing two tabs independently. Here they are: Split 2 T/B Split 2 L/R
To bail out of a frame, Rightclick - switching back to full-tab mode is on the context menu.
Initially-unobvious-to-me points these buttons required or revealed:
- Opera variables become javascript variables if parameter is 0.
- quotes have to be escaped through two levels: %22 is the first level, but if that were in the installer it would get interpreted by Opera during install, resulting in live quotes in the button code, causing misreading on execution; so one must escape the % - which becomes %25, making %2522 the needed double-escaped quote. Opera then puts %22 in the button, and the live quote finally appears at the right level. (What you see on the installer alert box has already burnt off one level of escaping.)
- a quirk of Opera's command interpreter causes failure if one generates a frameset page where one of the frame URLs contains a "#". This is common - used to target a location within a page, and as a hashmark in database URLs. Solution is to use javascript Replace command to escape all #s.
- the split-page buttons which have been on the Wiki's Power Buttons page all these years don't escape # - and are thus (in the context of Opera's flaw) seriously defective. They even fail when tested on the page where they're posted, for example, if one navigates to their section via links - and no-one has remarked on it or sorted it out. Weird... another case, I guess, of people too trusting to really register or make sense of systemic defects when they encounter them; which explains many things.
2009-11-23: finicky IDX: case in URL has to agree for panel icon.
One of my local panel files was only showing its icon sporadically - eventually realized it was the only one where there was a mismatch in case between the URL in the localhost IDX and the one in the bookmark (folder called "HTML" in one, "html" in the other). Fixed that - fixed the flaw.
2009-11-15: Back/Forward In New Window
added to dropdown menus for the Back/Forward buttons. See Buttons post.
2009-11-15: button help demo
For toolbars where button titles are not shown, you can put as much text as you like in a button's title - which then pops up as a tooltip when the button is hovered.\n Here's a demo: drag this paragraph to a toolbar where only icons are displayed to have a useless button with a lengthy title.\n Button titles are defined by the third parameter or - if there is none - the anchor of the installer tag.\n So type whatever you want to have pop up in a tooltip as the installer-tag anchor; when you hover the button, you'll see it.\n This particular button has no real action - it's just a way of providing the tooltip.\n But one could use the method to include instructions or explanations with any button.\n
Backslash n, as in javascript, works as a linebreak.
For an info-only button (which works even where titles are shown on the bar), one could also use a javascript alertbox: info (drag to toolbar)
So here's an idea: Opera could install with these things all over the place - popup help to explain contexts (such as the mail system, the links panel etc.) and get you started; with the invitation to delete the buttons once no longer needed. Like info stickers on a product.
2009-11-14: Contacts panel part of mail system (noob-unobvious critical fact)
It's easy to start using Mail (like I did) without realizing that it's designed to work with two of Opera's panels - Mail and Contacts. That means you're using only parts of a system. Clicking a Contact opens a tab with a view/filter of all messages to & from the contact. That's very user-friendly - it duplicates the folder functionality most are used to - but you need to be quite a keen reader of documentation to be notified of it. The Contacts panel is not mentioned in the introduction to mail - which is a page long enough that a person who gets through it will imagine they are good to go. It is explained in the multi-page mail tutorial - but that's second-level help most (I think) will never read through. The noob would have nothing to discover if Contacts were included as a folder (or just a button that invoked the Contacts panel, which could be treated as a temporary teaching device) in the Mail panel - and the Mail panel opened by default when Read Mail was invoked. The current system is fine once you know about it - just unobvious if you don't; but in a busy world noob transparency is important - and it's not hard to achieve if you recognize its importance.
2009-11-10 mail subfilters quirk
if parent filter has "mark as filtered" checked, no messages are listed in subfilters (despite count being correct) - until "mark as filtered" is checked in the subfilter as well. A senseless requirement - what should be required is just "show filtered" - ergo, a UI bug.
2009-11-7: need two Google searches
used to be phrase search without g prefix, wordset with - but Opera 10 does whatever g search does when no g. So - I've put quotes around the %s in the address field (Prefs / Search / (select Google) / Edit / Details), making the default a phrase search, and added a second Google search without the quotes, different prefix, for wordset searches.
2009-11-7: dialog.ini is not the whole story
Took a look at combining Save Session and Manage Sessions dialogs, so one could see the list while naming a session - and was surprised to find that dialogs are not fully specified in dialog.ini. The same code produces two different dialogs, depending on the name. To see this, copy this into a custom dialog.ini and restart to see the effect:
[Save Session Dialog]
Group0, 0, , 10, 10, 300, 200, Size, End
Treeview4, 0, Sessions_treeview, 0, 120, 150, 150, Size
[Session Manager Dialog]
Group0, 0, , 10, 10, 300, 200, Size, End
Treeview4, 0, Sessions_treeview, 0, 120, 150, 150, Size
Then look at the Save Session and Manage Sessions dialogs generated by the File menu commands: former doesn't show the list; latter does, and is bigger - from the same code. So - there is some file we don't have access to that is involved, and has info about what the names mean. At which point the hacker is basically defeated.
2009-11-7: launch sessions by name
session launch is GUI-gesture only, usually - interacting with a dialog. Macros which try to achieve an expected outcome with navigation commands are brittle, defeated if the list changes. So here's a fixed command which reliably launches a named session, regardless of list changes: "exit & execute (named session)." Closes Opera, executes the session file in Windows context - which, presuming you've registered Opera to open *.win files, relaunches Opera with the session. Not suited for every need, but worthwhile for some. And no, "execute (session-name)" without exiting first doesn't work.
2009-11-7: quick-start utility
quick start for "resume" users: rename autosave.win; swap in empty session; launch. There's a theme here: knowing what system files do and being fluent at swapping them, you can manipulate the system in ways not otherwise possible. Utility presented (copiable) in Better Sessions post.
2009-11-6: register Opera to open sessions files
in Windows Explorer, associate the WIN extension with Opera (Tools/Folder options/Filetypes/New). Then you can put shortcuts and links to sessions files around your system, and clicking them will open Opera and load the session. This is particularly useful if you use the "open with home page" setting, which obliterates the autosave.win file on startup and makes it impossible to recover what you had open after a crash: keep a link to autosave.win available, and clicking that after a crash will open Opera with the autosaved session from before the crash.
2009-10-24: view mail files within the browser
I had to export and then re-import my mail to clean out something that was disabling filters, and a few mails got lost with each operation (which, incidentally, does not seem good!). So to get them back I needed to inspect the .mbs files (each one an email) in my backup of the mail store. Turns out they're standard Unix mail format, which is plain text - can view them by associating the .mbs extension with a text program such as Notepad. However, there's a better way: view them in Opera, and they're formatted. To do this, you need to add mbs to the set of extensions which Opera is to treat as text and open. That's: Prefs/Advanced/Downloads; uncheck "hide file types opened by Opera"; type txt in the quickfind box (should bring up the line for mime-type text/plain); add mbs to the extension list, and make sure "open with Opera" is checked. (My list is: txt,ini,dat,lng,mbs,adr - which covers most of the guts of Opera.) Then bookmark your mail store folder and you're all set to look under the hood if the system starts acting up.
Incidentally, the mail store proves to be very sensible: folders for day, month and year, all properly numbered; and the mails themselves just text files. Having been through misery trying to get into old Outlook Express archives, this is nice to see.
2008-8-24: g prefix: wordset search; no prefix: phrase search
There's a big difference between a wordset search and a phrase search - the latter, enclosed in quotes, looks for the exact string and is much narrower. So it's handy to be aware that you can generate either one by typing in the address field. Try it out: type at break of day arising in the address field, and hit Enter: 15,000 hits. With the g prefix: 800,000 hits.
2008-8-20: saving notes as text
You can save notes.adr for archiving, and swap old versions in for viewing using the Notesfile preference - but it's handy also to be able to get notes out of the proprietary format, into a plain text file. Not hard: with cursor in tree pane of notes panel, use Shift+Right to open all folders - then the result of Select All, Copy & Paste (into text file) is all the content of your notes file, in a normal text format. For a file of only selected folders, use Range Select (Shift+click) instead of Select All.
2008-8-15: button storage: use bookmarks
those things we drag to toolbars to install buttons are, in format, URLs - and can be bookmarked. So if you rightclick a button-installer pseudolink (excuse me for inventing a clear term, but that's what they are; also tags - "installer tags" is clear; what they're not is buttons) and bookmark it, you've captured it and can install any time by dragging from the bookmark to a toolbar. This is excellent - you can have a buttons folder, with as many subfolders as you like - and can write as much about source and anything else as you like in the description field. Get used to that, and you may get in the habit of installing buttons for use, then discarding. If so, this macro will open the bookmarks panel and use Quickfind to show all your installers:
focus panel, "bookmarks" & Focus previous widget & Focus previous widget & Focus previous widget & Focus next widget & insert, "opera:/b"
(note: Quickfind doesn't execute until you manually generate some input - so you have to type the next character, "u", to prod it into life.) Doing it manually, you'll probably find that "/b" is enough: all installers have it, and there won't be many false positives.
2008-8-15:Windows panel header is a display-order control
Click it, and you'll see up and down arrows appear - it's a three-way cycler for sort order: tab bar order, alphabetic and reverse alphabetic. (I would imagine most people never discover this, since there's nothing about that bar to suggest it's a control - and the default setting is unmarked. At a minimum, there should be a symbol that means "tab-bar order" - seeing it would alert people to the fact that the feature does something. Better yet, radio-buttons - which make the set of options glanceably obvious.)
2008-8-15 quick blog backup
(because, as this week shows, you never know): go to your Archive page, open the Links panel, and use range select (Shift+click) to select all your recent posts, or even just all your posts - the actual saving is over in a flash anyway, so don't need to be fussy about avoiding duplication - just grab everything, and throw away your old snapshots (unless you want the history of revisions). You can use Ctrl+click to unselect items such as the month listings if you like - or just leave them in on keep-it-simple grounds. When you have th
flag icons so they survive Delete Personal Data: Read-only attribute.
from lcase "Go to your profile>images folder and find the icon and idx file for the site. rt click on them then rt click propertys, then check read only on the propertys box and save. Make sure you do it on both files. This will prevent them from being automatically deleted when you clean your cache and your icons will be there for you."
stop alarming and wasteful IDX history storage using root URLs
Left to their own devices, the IDX files which now associate favicons with URLs do some very questionable things. They like to make a record of every URL you visit, and can end up hundreds of KB long and a privacy nightmare. The rationale is opaque - often you will see dozens of pages within a site listed, all having the same favicon. But garyy811 spotted a way to tame them: "I found that if you cut all the excess information in the .idx and leave only the "www.domain.tld" and the icon reference, there won't be any new entries."
Note that last two tips overlap - if you write-protect IDX it can't grow. (What happens if pages with new icons are visited at a site with a write-protected IDX: do IDX's proliferate, so that the growth is merely shifted? Seems not - the page uses its own icon, but no new IDX appears. EDIT, 2009-11-30: Pizzapops says write-protecting IDXs works for assigning icons to pages; to a degree: the assigned icons show up in bookmarks panel, menu, and personal bar - but not on tabs or address field, where the author's icon still shows up.)
the ABBR tag (from "abbreviation") is an HTML feature that has been ported, in a slightly modified form, into Opera's forums (where it works in both posts and signatures) - and adds a welcome degree of freedom to how you format and present things. The purpose of the tag is to provide an on-hover popup, and a visual signal that it exists. In HTML, it uses the title attribute (which you can actually add to any tag) - and puts a dotted underline beneath the tag anchor to let you know it's there. In the forums, the format is simpler:
[abbr tooltip]anchor[/abbr]
and again there's a dotted underline. In blogs, the BBCode tag works with the flaw that the underline is omitted. Here's the tag from the code box (hover for effect): anchor
As far as I know this is the only way to get a popup into a forum post. Demo, using underline to reveal presence of the tooltip:
spoiler: "Can you name the two classes of mammals which lack bellybuttons? Hover for answer."
view & copy button code from installer alert box
Easiest way to grab the code of a button: drop it on a toolbar, so the "Install?" alert box comes up. The code is shown there in clean readable/pastable form, and you can copy off the alert box. Look at it, copy if you want, then click the alert-box cancel. (Another tip: you can paste button code right into keyboard or mouse customization fields. Irrelevant parts - icon assignments and + actions - are just ignored. A benefit is that you can then re-buttonize the function very easily - instead of having to maintain two forms.) But... as of now, there's a bug which causes javascript buttons to fail unless the colon after "javascript" is escaped - and the escaping is lost if you copy off the alert box. So make sure to restore the %3A with javascript buttons.
assign icons to (many) local files by making (one) localhost.idx
This IDX file which now handles icon association has confused a lot of us. Turns out you don't need an IDX for each page or icon - it's more like one per site. And localhost counts as a site. So the procedure for associating icons with local files is now:
-make a "localhost.idx" file in your Profile\Images folder Opera 10 uses an Icons folder, which ends up in Local Settings (which is a little off the beaten track): c:/Documents%20and%20Settings/username/Local%20Settings/Application%20Data/Opera/Opera/icons/
-put your icons there too (with simple names - no need to copy that escaped-URL stuff)
-make a two-line entry for each association, within localhost.idx.
The entry is simply the href of the file (i.e. pathname, with "file://localhost/" prefixed - what you see in the address field when you open a local file, and in fact launching the file and then copying from the address field is a handy way to get it) on one line, and the filename (just name - no path needed) of the icon on the second line. So an example is:
file://localhost/C:/windows/application%20data/opera/opera%209.5/profile/menu/mn.ini
menu.ico
And you have to restart Opera for assignments to take effect. Then, since this is now one of the system files you'll be accessing frequently, you may want to add the IDX extension to the list of those associated with the Text/plain MIME-type and opened by Opera. You do that at Prefs/Advanced/Downloads. Then you can nickname the file IDX, put a GoToPage,"idx" on your system files menu and you'll be all set.







