Underscores between words in default File Save name

• Jul 22, 2015 - 11:38

On first saving a file the default file name has underscores between each word. Is there any way to change this behaviour i.e not to have the underscores ?


In reply to by Nicolas

I agree with sjha that the underscores are a nuisance. I was very disappointed to discover that behaviour. The site you reference is four years old. My Macs have always coped happily with spaces in the names and I rarely need to post to the Internet. It should be an option.

In reply to by cwhysall

The problem is the "escaped where necessary" - yes, they *need* to be escaped where necessary, but all sorts of problems can ensure when they are not. If you promise to only use the file on your own system and always take the proper care, you are of course welcome to use spaces, but it's a bad idea in a connected world to share these files with others that way if you can help it. Which is why the default is to not use the spaces.

In reply to by Marc Sabatella

But why is MuseScore 2 the first program I've come across that imposes this? With programms like Photoshop, if you save for web then hyphens are automatically used, and that is appropriate. Otherwise the choice is yours. It is not as though MuseScore is web-first, unless that is what you are trying to push.

My guess would be that most people are notating for their own use, not the web.

Please do not become Adobe.

In reply to by cwhysall

It doesn't "impose" anything. It merely makes a suggestion you are free to overrule with a few keystrokes. What other programs do you have that suggest filenames for you at all? It's a pretty unusual use case to have a "title" for a document that the program knows even before you've saved the file that can be used as the basis for a suggested filename. Most programs simply called newly-created documents "Untitlted" or the like and you have to type the filename yourself. if you prefer that behavior, simply skip entering a title when creating your score, and then the behavior will be just like other programs :-)

MuseScore *does* try to encourage score sharing - see the musescore.com, the mobile apps, etc. It's actually a pretty important part of how MuseScore is used for many people. I don't think it makes sense to have defaults that make this more difficult.

In reply to by Marc Sabatella

It is true that most things you do do not inherently have a title, hence a title and filename are separate things. However, replacing spaces with underscores is an imposition that I find irritating. Similarly to Photoshop, they could be inserted when uploading but left out otherwise.

I know that most programmes give "Untitled" as the default file name when first saving. But my concern is that I open a MuseScore 1 file which has no underscore in the title in MuseScore 2 (which I am doing a lot of at the moment so that they can be used in Songbook). On saving, the default title comes up with the underscores. And to remove these requires a lot of clicking and deleting. Why can the file not be Saved As the original title without the underscores? Or at least have the choice in the preferences to have this as the default behaviour?

In reply to by sjha

Is there an actual problem I am not understanding here? As far as I can tell, the underscores help in a lot of cases and never cause the slightest harm. Why not leave them alone? I'm not crazy about making the UI more complicated adding options that serve no actual purpose solving an actual problem.

In reply to by Marc Sabatella

Let me say that I am a great fan of MuseScore and recommend it whenever I can. I have Sibelius that I came to hate when they moved to V7, and Finale that I cannot make sense of at all.

I was very surprised to find underscores defacing my screen when MuseScore V2 came along. They are ugly, and make long file names more difficult to read. I find them thoroughly annoying and have simply put up with the fiddle of changing them every time.

But now someone else has shown their irritation with them I thought it only right to offer support. It might be that others are also quietly annoyed by it.

I could say why underscores and not hyphens? I seem to have noticed a tendency to prefer hyphens in URLs. But please – not hyphens either!

But I do love MuseScore. By far the best notation package out there.

In reply to by Marc Sabatella

I think there is an actual problem. Let's say that I have a MuseScore 1 file called "Do you know what it means to miss New Orleans?.mscz" I want to convert it to MuseScore 2. I open it in MuseScore 2 and save it. MuseScore 2 offers to save it as "Do_you_know_what_it_means_to_miss_New_Orleans_.mscz"
It is extremely fiddly and an annoying waste of time to click and delete all those underscores and add back the question mark. Nothing else on my computer has underscores in the file names and I don't want my MuseScore files to be the exception. So I can't see that it would be very difficult to simply allow a choice of whether the default file name should or should not contain the underscores.

In reply to by sjha

What I am asking is, *why* are you bothering to remove those underscores? They serve a very real purpose and cause absolutely no harm.

Anyhow, there are also other ways of achieving your end goal here. For example,. just click the original filename in the file selection dialog - that automatically replaces the suggested filename with the one you are selecting. Or have a script that goes through filenames and removes underscores - surely if this is a common concern, such a script must already exist and be widely available.

Anyhow, I hope to not have anything more to say. I get that a small number of people will prefer to have spaces in their filenames despite the good technical reasons not to, and they are free to take whatever steps they like to override the defaults, but I see see no reason to have two different sets of defaults.

In reply to by Marc Sabatella

Thanks Marc. Your suggestion to "just click the original filename in the file selection dialog - that automatically replaces the suggested filename with the one you are selecting" solves the problem for me. I had no idea that this would work - good to learn something new!

In reply to by sjha

Just to be clear, I didn't invent this behavior, nor was I the one to implement it for MuseScore, nor am I the only developer. I'm just expressing my personal opinion as one of many who works on this program.

I'm not completely unsympathetic - I often use spaces in my filenames as well. But I do understand and accept the reasons for this, and I have an aversion to constantly adding options every time someone prefers a different default. I occasionally propose such options myself, but if we did that all the time, it does not really help usability to have that many options. So I find it best to limit this to the cases where it makes a real difference. Saving a few people a few seconds once in the lifetime of a score does not strike me as a big enough win to justify it. But again. that's just *my* opinion.

In reply to by sjha

I'd almost agree with you, too—I like spaces better than underscores in file names, I guess—except who cares? What difference does it make? I didn't actually set up that Automator folder action I mentioned, and I don't plan to. It's not worth the effort, nor is it worth the effort to get worked up about it.

In reply to by cwhysall

Of course we listen to users. The problem is, not all users feel the same about all issues. Very many will be happy that everything works perfectly out of the box, no need to add underscores to filenames to avoid the many & significant problems that spaces in filenames can cause. Some will be unaware that there are such problems but will nevertheless be happy with the defaults. Others will be unaware of the probloems and will blindly remove the underscores then wonder later why they have problems. Others will be aware of the problems but know how to avoid them and will remove the underscores and have no problems. Some will wish there was option to control the default. Others would find the hundreds of options that would result from adding an option every time someone requests one overwhelming, and it would make it harder to find the options that actually matter. Plus each option makes the program more complex and harder to support, making it harder to focus on adding features and fixing bugs. And I think I think most users would prefer we focus on features and bug fixes.

So, lots of different users, lots of different wishes. We might "listen" to them all, but in the end, we have to make decisions about what default behaviors should be and how many options to override these defaults we are willing to saddle users with and how many features and bug fixes we are willing *not* implement in favor of adding such options. Just because a particular decision doesn't go your way, tht doesn't mean we don't listen to users.

In reply to by Marc Sabatella

When Apple introduced OS X, I was astonished at how simple it was to use. I came from a background of technical work at BT laboratories, where Unix expertise made you a very special, highly paid individual. To know the arcane mysteries of the Unix command line was a rare and sought after skill.

OS X is Linux with an administrator built on top so simple that anyone can handle it. All of that black art was made redundant instantly.

And that is the approach that should be taken here. The problems you allude to should be handled by the software. In fact, although I am quite technical and use Linux and OS X (never Windoze), I do not know what problems you are referring to.

One thing I have checked is that OS X can find scores with underscores in their names even if I search with spaces. It does. Luckily. It would have not been a surprise to find it didn't. I haven't tried other systems.

In reply to by cwhysall

Do you have or know a 'make' command that can deal with spaces in filenames (as far as I know there is none)? Ever had to use the 'find' command to deal with such filenames (can get made working, but only by using black arts)? Ever downloaded files with spaces in their names and ended up with filenames containing %20 instead?

In reply to by cwhysall

The user won't have to deal with those, when sane defaults like underscore instead if spaces are used, nor any special computer power is needed. Zack explained to you how to automagically convert underscores to spaces on a Mac (and I don't know whether the same is possible on Linux or Windows and how difficult it might be, and I don't really care either), just uses that and live happy ever after ;-)

In reply to by cwhysall

I'm not saying *MuseScore* has problems with spaces in file names; it doesn't. The problem is other software that may not fare so well, and command line usage especially.

If you are not familiar with the problems I allude to, then that is all the more evidence in favor of the default being exaqctly what it is. But FWIW, try opening a terminal window in Linux and typing the following, exactly, and seeing where that gets you:

rm My Score With Spaces In The Name.mscz

Also for grins, try copying and pasting the pathname into different web browsers on different OS's and seeing how they handle it.

The problem is, everyone who ever accesses that file needs to know how to properly deal with files that have embedded spaces in the name. In a conencted world, that's not a reaosnable thing to assume. That's why I think it a good idea for programs that produce files liekly to be shared to avoid spaces by default - because even if *you* know how to deal with the issues, that is no guarantee that everyone who ever accesses that file will.

In reply to by cwhysall

The average Joe encounters *lots* of situations where he might need to type filenames, not just terminal windows. And as mentioned, browsers generally choke on spaces, or convert them to the even uglier %20.

Again, just because you personally on your computer running your favorite OS knows how to avoid the problems inherent in using spaces, don't assume that the entire world does or that they will never run into those cases. It really is a real problem in the real world, and there is no way MuseScore can protect you from that, since the problems will come in when using *other* programs. That's just the way it is, and no amount of wishing it weren't so will change it. It's been this way for decades and is not going to change today or any day soon - not until AI is perfected. There is just a very fundamental problem with spaces in filenames that cannot help but be an issue in any situation where you might possible be asked or allowed to type a filename. There is simply no way for a program to always know whether My First Score.mscz refers to one file or three. In a "Save As" dialog, it obviously means a single file, but in any other context, it just won't be obvious. That's why web broesers replace spaces with %20, and why lots of other things are done to work around this fundamental problem with the whole idea of spaces in filenames. Pretending it isn't a problem won't sovle it.

In reply to by Marc Sabatella

You are contradicting yourself here. I can't think of many situations except file creation where someone needs to type a file name. I assume that we are talking about windowing GUIs.

I don't know anything about knowing how to avoid "the problems inherent in using spaces" as I don't know of any when using a GUI.

What is interesting that is coming out of this debate is that you seem to be promulgating an idea that just because of some low-level issues that are a legacy of early computing, the whole world should learn to use their natural language differently. I'm afraid you will never get me to agree with that.

Databases also have problems with spaces and many other characters that people use in their natural language. They deal with them quietly and invisibly. And so it should be. Isn't that what computers are good at?

The first time I used a credit card on-line (seemingly a long time ago now) I was surprised that it was rejected. I had entered it as it appeared on the card. I eventually realised that someone hadn't had the nounce to write a little bit of Javascript to remove the spaces. I don't expect it to happen these days.

Of course, I could try using underscores.

In reply to by cwhysall

I'm glad you never encounter the very real problems that can occur when using spaces in filenames. But please just accept they are real even though you personally have never encountered them.

It's not just about ancient OS's. It's inherent in the whole idea. GUI's can protect you to some extent, but not fully. It doesn't matter how well MuseScore itself handles them - we can't rewrite the web protocols or every shell script or plugin in the world or even GUI programs that invoke other processes using system() instread of exec() or that ask you type multiple filenames on a single line, etc. There *are* and *always will be* issue with spaces in filename in these situations, period.

I'm glad you've never encountered them, but please don't insult me by telling me that I haven't seen them over and over and over in my own dealings with computers and in supporting other users over the course of my 30+ years in the software business.

Can you please let this drop?

In reply to by Marc Sabatella

Marc, I was happy to let this drop a long time ago, but no one seemed to pick up on the distance from the real-world, non-computer technical composer and the low-down grubby world of low-level computer operating systems. The whole point of the GUI being to protect the real world from it. I know very well what goes on below, I've worked with it long enough.

So I would not thik of insulting you or any of the team. I think you have and will continue to do a briliant job. This issue is the only niggle I have with the software. I only commented in the first place so that the original poster would know he was not alone in being puzzled by it.

So be happy – I will promote MuseScore whenever and wherever I can.

As a default file-naming convention I feel it has many advantages not the least of which is that you don't overwrite the original. I'd go further and add modified ISO 8601 date (adding time saved) to give a filename such as Directory_Subdirectory_Filename_20150723_0008 so that you create your own backups as you go along. It's not as if it's difficult to do Save As and assign the name of your choice if you prefer or to change the name of the final file when you're done creating/editing.

In reply to by underquark

The big problem with all of this approach is that it is nerdy and geeky and doesn't present MuseScore as a friendly program that non-computer geeks will be comfortable with.

If I come up with a new tune I often name it as YYYYMMDDx because I understand how these things work and know that that will keep them in order, but it isn't something I would teach to a non-computer savvy person. It is confusing to them. Thus the technical reasons for adding underscores is baffling to them.

Underscores are also not the most convenient character. I imagine plenty of people don't even know where it is on their keyboard.

You really have to take the Apple approach to design in these areas and ask what is most familiar to the user? No-one speaks or writes with underscores.

In reply to by cwhysall

the underscore is at exactly the same place as the -, at least on a German keyboard, just needs an additional Shift.
But users don't need to know where that key is, MuseScore adds that all by itself and in a GUI file selector you'd never have to enter it yourself, you'd just point and (double) click it.
Spaces in filenames are evil, period. If you want them, add them yourself, but don't force them upon others.

In reply to by sjha

Good, then we are agreed - you are not forced to use them. Simply choose not to accept the default when offered. Either remove the underscores in the filename, or click an existing filename to use it, or type the filename yourself when creating a new document exactly as you would have to in virtualy every single other program :-).

But for the record, the problems being discussed specifically has to do with the things you *do* with those files, and in particular, the idea that you might share them online (where the spaces most definitely *are* problematic in URL's), open them in other programs (eg, use them as arguments to shell scripts, plugins, or makefiles), or share them with others who might be needing to do those types of things.

Most of those files on your Mac sit only on your Mac and are never shared or processed in any way by any program where the spaces might present a problem. It is when files have any possibility of being used in other ways that problems *do* happen, whther you personally are familiar with these problems or not. They exist - they have existed for decades, and will probably always continue to exist, because the basic issues are fundamental to why spaces exist in the first place - to separate things, both words within a filename and filenames within a command line or other string that can possibly accept multiple filenames.

Hmmm, may I add my 0.02€ by telling that I am finding the whole discussion interesting but a bit surrealistic?

Maybe I can add a very little bit of perspective by impersonating a user with specific needs:

The great majority of my scores are not made of a single piece each, but are collections of several pieces. I find MuseScore habit to guess a file name from the title of the first piece incomprehensible and irritating, as the title of the first piece has nothing to do with the title of the whole.

This forces me, the first time I save each new score to press [Del] to get rid of that useless file name. So, I urge the developers to change this strange behaviour. Or, if somebody for whatever reason finds it useful, at least to add an option to the preferences stopping any file name guessing.

Perspective, please, perspective...

This is an interesting discussion from which I have learnt a lot. However I have not been convinced by the arguments for including underscores in the default filenames. The argument as I understand it is that there are certain situations where spaces between words in file names can be problematical. In particular i) when the name is a URL and ii) when used on a command line e.g. in the Mac Terminal. This is indeed correct. However I have to ask how frequently this arises. I would be pretty sure that virtually all users of MuseScore neither have their score titles as URLs nor work on them in a command line. Therefore it seems to me that the default situation should favour the vast majority and omit the underscores when proposing a name for a new file. In the Preferences there could be a setting to change this behaviour to addition of underscores for those few people/situations that want/need this. Since the proposed file-name is taken from the title given to the score when initiating it this preference is surely a simple coding matter that could easily be incorporated. To those who disagree with this approach I would also point out that Sibelius does NOT add underscores to the proposed name for saving a new file. So why should MuseScore be different?

In reply to by sjha

As I have said before, I am glad you personally don't run into these issues, but please accept they are real. The world is a big place full of lots of people who do lots of things with their files in which spaces are problematic, and many of these people are not sufficiently expert to know how to avoid these problems nor would they know to go hunting for an option to change this behavior that they wouldn't even realize they needed until they had already experienced problems.

*Please* can we let this drop? Some day, maybe someone will decide this is worth doing, but all possible arguments have already been made. There is nothing to add.

In reply to by Marc Sabatella

I know I'm really, really, really late for this discussion, but I've been wondering the same thing for the last few months, finally decided to look it up.

To make peace, is it not possible to simply add another option under preferences called "replace spaces in filenames with underscores", and then to appeal to those who like it and for legacy purposes have it on by default, and then those who don't like it (myself included) can just turn it off? :-)

Love everything else. Thanks Marc and team for your patience and phenomenal work!!

Underscore or spaces? MuseScore will do either.
Using the "Save command" offers a file name using underscore characters
Using "Save As" command offers a file name using space characters

I save my files containing spaces instead of underscores...

Litte question:
hmm... While creating scores, I always put the filename in the footer text using $f.
Al works fine... The filename appears in the footer...

After uploading my file online and then consulting the score online,
the footer contains a strange string of characters (score-zggbsdd5677dgmanw...) where normally the filename should appear.

Is this due to the spaces instead of underscores thingy?

Thanks for any suggestion or solution...


Hi, I'm about 5m in, and don't want to waste more time reading this massive 7yo thread...

So, do we have a way to disable this default underscore behavior? I can't find it. I've had to built workflow to get rid of these characters so that names look normal like all the rest of my songs.

Thanks in advance!

In reply to by Jm6stringer

Thanks so much for the reply :-) But it's not an acceptable solution.

I've read a substantial amount of pontification and zealotry here about the sin of blank spaces in file names. I've been not only an aggressive computer user, but also and admin and software developer on *nix, Mac, Windows, and their OS predecessors for >40 years, including starting and building an ISP and developing carrier-grade software infrastructure for a telecom. And that attitude I'm reading here is pretty nauseating.

Years ago, during the Jurassic, we avoided spaces in file names, especially on servers. It had a lot to do with the fact that the Unix shell parsed tokens on white space, so it took extra programming effort to accommodate spaces, and so they were avoided in file names. In that case, shell programming was elegant, and the compromise was acceptable.

But that was >25 years ago, and was primarily for server files, like logs. It turns out that technology has improved since the 90s. Plus, almost every file you can download off the Internet has spaces in their file names now because web servers all know how to handle spaces (and other special characters for that matter; Google "URL Encoding" for starters). And, of course, practically NO consumers maintain files on their PCs with underscores delimiting their file names... except for the ones produced by MuseScore.

And even if there were some good reason to keep underscores in the default file name (there's not), last I checked many MuseScore users don't live in a communist country where we don't have choices. There's no reason the "underscore default" should not be disable-able by users. But if I have to give one easy counter-example, consider this screenshot from perhaps the premier gigging app for iPad, iGigBook Pro:
Can you guess which are the only two entries that came from MuseScore? Not only do they look out of place, but searching and alphabetical sorting don't work consistently between them and the other songs.

In reply to by reggoboy

That's great that you have so much experience with programming on so many operating systems! So, obviously, you have managed to learn how to avoid the problems that are unfortunately still present with space (shell scripts are still a thing, for example). But please keep in mind that most users are not as expert as you. And that's why the defaults are designed to protect the average user from accidentally creating a file that will cause them problems later - because they lack all the great expertise you have. But rest assured, you continue to have the choice to specify spaces instead, and so do other users - no one is forced to accept the defaults.

None of this is to say that it will forever be this way. But anyone with the experience you have surely should understand that the problems do still exist and can potentially still affect less experienced users.

In reply to by Marc Sabatella

I've given up on changing the minds of the developers on. this issue. Their views seem to be set in stone. However other users who like me are irritated by this file naming behaviour might like to note that there is a relatively simple way to address the matter. I periodically go through my folder(s) of .mscz files, some of which may be saved with underscores and batch rename them as follows (these instructions are for the Mac, but a similar procedure is, I believe, possible on Windows):-

  1. In the Mac Finder, open the folder where the .mscz files you want to change are stored.
  2. Select all files in the folder.
  3. Click on the Action button to perform tasks on the selected items at the top of the Finder window.
  4. Select Rename...
  5. Select Replace Text from the drop down menu
  6. Enter the word or words you want to change in the file names, in this case the underscore (_)
  7. Enter the word or words you want to replace them with in the file names, in this case a space
  8. Click on Rename

In reply to by Marc Sabatella

> So, obviously, you have managed to learn how to avoid the problems that are unfortunately still present with space (shell scripts are still a thing, for example). But please keep in mind that most users are not as expert as you. And that's why the defaults are designed to protect the average user from accidentally creating a file that will cause them problems later - because they lack all the great expertise you have.

Wait, what? You completely misunderstand. I'm not using my skills to deal with problematic spaces in file names unless I'm writing low-level enterprise code on a server for a business application. On desktops (Mac, Windows, Linux) which is where MuseScore users live, spaces in filenames are already NOT A PROBLEM in the first place, and so there's no expertise required to solve any problem.

Quite the opposite, people are having to write programmatic solutions (see sjha and others above) to work around the fact that MuseScore is artificially ADDING underscores here. MuseScore is CREATING the problem, not helping to solve it.

In reply to by reggoboy

I was the originator of this thread. My request to give users the option to make the default behaviour of Musescore to Save files with spaces instead of underscores was met with a blank refusal by the developers. It seems that nothing has changed during the last 7 years

In reply to by reggoboy

Are you suggesting you have interviewed each and every one of them to confirm none of them has ever experienced such a problem?

I believe you when you say you have a ton of experience here. So I also trust that, as someone with all of that experience, you understand exactly what the potential problems are. What mystifies me is your faith that somehow everyone on earth manages to avoid these problems. I see people encountering these problems all the time - just helped someone deal with this a few weeks ago in fact. Perhaps we just have different circles of friends, family, and people we interact with online. but trust me - people who don't understand these issues and get bit by them do exist.

Anyhow, as you know, MuseScore is open source. Someone with your level of experience should also be able to implement an option for this, and also write up the documentation to explain to users the tradeoffs involved. Or if you decide it's not important enough to you, maybe someone else who has an equal level of experience and skill will volunteer.

EDIT: actually it looks like someone has already done this for MuseScore 4

In reply to by Marc Sabatella

... if you decide it's not important enough to you,...
it looks like someone has already done this for MuseScore 4

Perhaps it was not important enough for that "someone" to "scratch their own itch" but rather to cordially resolve this 7 year old 'feud'. :-)
Kudos to that "someone".
Viva open source!

In reply to by Jojo-Schmitz

Seriously? With all the important things that could be improved, we are all twisted about spaces in file names? Some of my files have spaces, some have underscores. It doesn't change anything. Nothing. I to go back to a time when underscores were needed. Sometimes I still use them. But, in the long run, Who Cares?

In reply to by Marc Sabatella

@Marc: where do you see this? I don't. The renaming is done in path.cpp, mu::io::escapeFileName(), and as far as I can see always and unconditional

u::io::path_t mu::io::escapeFileName(const mu::io::path_t& fn_)
    // special characters in filenames are a constant source
    // of trouble, this replaces some of them common in german:
    QString fn = fn_.toQString();
    fn = fn.simplified();
    fn = fn.replace(QChar(' '),  "_");
    fn = fn.replace(QChar('\n'), "_");
    fn = fn.replace(QChar(0xe4), "ae"); // &auml;
    fn = fn.replace(QChar(0xf6), "oe"); // &ouml;
    fn = fn.replace(QChar(0xfc), "ue"); // &uuml;
    fn = fn.replace(QChar(0xdf), "ss"); // &szlig;
    fn = fn.replace(QChar(0xc4), "Ae"); // &Auml;
    fn = fn.replace(QChar(0xd6), "Oe"); // &Ouml;
    fn = fn.replace(QChar(0xdc), "Ue"); // &Uuml;
    fn = fn.replace(QChar(0x266d), "b"); // musical flat sign, happen in instrument names, so can happen in part (file) names
    fn = fn.replace(QChar(0x266f), "#"); // musical sharp sign, can happen in titles, so can happen in score (file) names
    fn = fn.replace(QRegularExpression("[" + QRegularExpression::escape("\\/:*?\"<>|") + "]"), "_"); //FAT/NTFS special chars
    return fn;

Do you still have an unanswered question? Please log in first to post your question.