invalid characters / syncing with Dropbox

Attached is a Unicode version of the script that replaces

  • ->, =>, etc., arrow-like strings with Unicode arrows.
  • Other illegal characters (including > and < not in arrows) with the corresponding Unicode fullwidth characters.

IMHO, this version generates filenames that are more readable than that given by ASCII substitutions.

The script also has some elaborated logic to handle “/” in Mac filenames.

The Unicode substitutions are:

<--> and <-> to ↔ (left-right arrow Unicode 034D)
--> and -> to ➝ rightwards arrow Unicode 2192)
<-- and <- to ← (leftwards arrow Unicode 2190)
<==> and <=> to ⇔ (left-right double arrow Unicode 21D4)
==> and => to ⇒ (rightwards double arrow Unicode 21D2)
<== and <= to ⇐ (leftwards double arrow Unicode 21D0)
> to > (fullwidth greater-than sign Unicode FF1E)
< to < (fullwidth less-than sign Unicode FF1C)
? to ? (fullwidth question mark Unicode FF1F)
* to * (fullwidth asterisk Unicode FF0A)
/ to / (fullwidth solidus Unicode FF0F)
\ to \ (fullwidth reverse solidus Unicode FF3C)
| to | (fullwidth vertical line Unicode FF5C)
: to : (fullwidth colon Unicode FF1A)
" to " (fullwidth quotation Unicode FF02)

Also attached is a Smart Folder that identifies filenames with illegal characters. To use: in Finder, unzip and copy into the Smart Folders folder in each EF library, click the “bad filenames” Smart Folder within a library, and select all files in the list window. Then run the attached AppleScript. (Note: the Smart Folder does not find files for which the only problem is that the basename ends with a space.)