The problem is that the said key combination DOES WORK inside Nisus Writer Pro (where you can get also smart quotes “”, having selected them in Pref.), similarly it does also in other applications, but NOT for instance in Textedit, in Filemaker Pro, and even now typing here inside this window, where - instead of the expected “” - I get the funny result {[{[{ (subsequently and anternatively).
[1] For smart quotes conversion, Nisus Writer Pro uses its own function. So it is natural that you get different results from other applications whose smart quotes feature seems to be buggy.
[2] I don't have Filemaker Pro and Safari 3.2.1 I'm running does not have the smart quotes feature. So I cannot tell about them. However, in TextEdit, when I hit shift-2, Italian Pro keyboard layout gives me correct results: " (smart quotes disabled) and “ or ” (smart quotes enabled).
[3] What makes the difference between us would be the physical keyboard. My Mac is connected to a US (ANSI) physical keyboard and yours would have an European (ISO) physical keyboard (or am I wrong?). So presumably the bug has something to do with the recognition of the physical keyboard type connected to your Mac.
But perhaps "Change Keyboard Type" (in the Keyboard tab of the Keyborad & Mouse System Preferences pane) would solve the problem. Try it if you have not.
But my macro doesn’t work properly and doesn’t esecute all occurrences in an unique command: sometimes it does work, sometimes it replaces only some vowels, sometimes I have to repeat execution on the selected text, and so on.
[1] If you do a Find and Replace, you will notice that the newly inserted text is selected. So if the first command successed, the selection is not the original selection any more but "À". That causes your macro to misbehave. When applying multiple Find and Replace commands on the same selection, you have to use not only
s option (in selection) but also
S option (keep selection). An appropriate set of find options would be 'EsSa-i'.
[2] There seems to be typos in your macro:
Code: Select all
Find and Replace '(A)(\'\’|`|´)', 'À', 'Esa-i'
Find and Replace '(i)(\'|\’|`|´)', 'Esa-i'
should be
Code: Select all
Find and Replace '(A)(\'|\’|`|´)', 'À', 'EsSa-i'
Find and Replace '(i)(\'|\’|`|´)', 'ì', 'EsSa-i'
So your macro will become...
Code: Select all
Find and Replace '(A)(\'|\’|`|´)', 'À', 'EsSa-i'
Find and Replace '(E)(\'|\’|`|´)', 'È', 'EsSa-i'
Find and Replace '(I)(\'|\’|`|´)', 'Ì', 'EsSa-i'
Find and Replace '(O)(\'|\’|`|´)', 'Ò', 'EsSa-i'
Find and Replace '(U)(\'|\’|`|´)', 'Ù', 'EsSa-i'
Find and Replace '(a)(\'|\’|`|´)', 'à', 'EsSa-i'
Find and Replace '(e)(\'|\’|`|´)', 'è', 'EsSa-i'
Find and Replace '(i)(\'|\’|`|´)', 'ì', 'EsSa-i'
Find and Replace '(o)(\'|\’|`|´)', 'ò', 'EsSa-i'
Find and Replace '(u)(\'|\’|`|´)', 'ù', 'EsSa-i'
Find and Replace '(à|À|è|é|È|ì|Ì|ò|ó|Ò|ù|Ù)(\'|\’)', '\1' , 'EsSa-i'
That works but if you want to make your code more economical...
[1] You can use
(?: ) instead of
( ) to gather elements in a group when there is not a back reference (such as
\1, \2 ...) corresponding to it.
(?: ) is said to use less memory but the difference should be unnoticeably small.
[2] However, in this macro, all elements in
( ) are single characters. So you can get rid of
| (OR operator) if you use
[ ] instead of
( ) or
(?: ).
[3] Instead of the last command, you can put
+ (one or more times) just after
[\'\’`´] of the preceding commands to remove those characters including repetitive ones.
Then, the macro will be something like this:
Code: Select all
Find and Replace 'A[\'\’`´]+', 'À', 'EsSa-i'
Find and Replace 'E[\'\’`´]+', 'È', 'EsSa-i'
Find and Replace 'I[\'\’`´]+', 'Ì', 'EsSa-i'
Find and Replace 'O[\'\’`´]+', 'Ò', 'EsSa-i'
Find and Replace 'U[\'\’`´]+', 'Ù', 'EsSa-i'
Find and Replace 'a[\'\’`´]+', 'à', 'EsSa-i'
Find and Replace 'e[\'\’`´]+', 'è', 'EsSa-i'
Find and Replace 'i[\'\’`´]+', 'ì', 'EsSa-i'
Find and Replace 'o[\'\’`´]+', 'ò', 'EsSa-i'
Find and Replace 'u[\'\’`´]+', 'ù', 'EsSa-i'
However, there is no need to write your macro in this way. If you find the original form more confortable, you don't need changing it.
Edit: I added two lines as I noticed another typo.