Eaglefiler seems to make use of names in the style of : libraryname/subfolder/filename, etc. … but when you sync with Dropbox, no Window computer can see a file whose name contains a “/”.
My efforts to strip these out using the file-rename script don’t seem to work. (I select library then run the script, searching for “/” and replacing with “.” or “|” (or somesuch). Is that the right procedure? A large swath of my files are not syncing …
If you mean this script, it operates on the selected files. Selecting the library itself will do nothing. Also, this script operates on filenames at the Unix level. So to search for “/” as shown in the Finder you would need to search for “:” (and vice-versa).
I’m not sure what you mean about “libraryname/subfolder/filename”. That looks like a path, not a filename. EagleFiler will generally only put “/” in a filename if you import a Web page containing that character in the title.
Yes, I was figuring out what you’ve pointed out. Drop box will give a list of “bad” file names, and it presents the whole file path, which confused me. I should concentrate on the name only.
Would it make sense to elaborate this script into a RenameForDropbox script to conform with the https://www.dropbox.com/help/145 stricture to “avoid characters incompatible with the Windows file system.” Perhaps a default substitution of a space for < > : " / \ | ? *
I don’t think that could have been done any faster. ;-> !
Iiuc, replacing with a space should suffice quite nicely for most cases. But as there might be special cases (such as backslashes needed in Applescripts for shortcuts), maybe include a caveat in the instructions?
I neglected to include the one other Dropbox requirement: trimming trailing spaces in the basename.
I was also thinking that perhaps the conversion should be more finely parsed to reflect how characters are typically (?) used in filenames – something like:
on processName(_name)
set _invalidChars to "<>//\\|"
repeat with _c in _invalidChars
set _name to my replace(_name, _c, "-")
end repeat
set _invalidChars to "\"?*"
repeat with _c in _invalidChars
set _name to my replace(_name, _c, " ")
end repeat
set _invalidChars to ":"
repeat with _c in _invalidChars
set _name to my replace(_name, _c, " -")
end repeat
return _name
end processName
AFAIR, within basenames, a space is a good-enough substitute for most double quotes, question marks, and asterisks. But as backslash, forward slash, and vert bar are only used as separators, a hyphen is better than a space for readability (IMO). I preceded the colon with a space to match the space that generally follows within basenames.
Thoughts about including the above in your script?
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.)