Problems with textutil on Mac OS X 10.6

Hi everybody,

The following command doesn’t work on my MacBook Pro running on Mac OS X 10.6:


do shell script "/usr/bin/textutil -convert rtf -font Arial -fontsize 14 /Users/martin/Desktop/test.txt"

The command does not care for the given font properties, the resulting RTF document always defaults to Helvetica 12pt.

Do you encounter the same problem?

Best regards from sunny and warm Berlin,

Martin

Hi Martin,

It works fine for me.

Great command”it works fine for me.

EDIT:
Oh, he is right. It doesn’t do it right. It only converts the text, not the font or point.

Found the problem! You have to put single quotes around the name of the font.

Example:
-font ‘Arial’ -fontsize 14

Works perfectly here. MacBook Pro, OS 10.6.3. ASCII text and UTF-16 with or without BOM.

Thanks for your help! Still, I am completely puzzled. Even if I am quoting the font name it doesn’t work on my Mac. Will now try it with a different user account.

If only I knew what’s going wrong…

Try this (change the username):

do shell script "/usr/bin/textutil -convert rtf -font 'OCR A Std' -fontsize 14 /Users/dylanweber/Desktop/test.txt"

It doesn’t work here :frowning: Even with a new user account I experience the same problem. Very obscure…

Ummm… Try to read the man page. I did, and your problem is weird.

The problem might be with your fonts, rather than textutil?.
Not that i know what that could be.

The command will not spit out an error if it can not use or find the font in question.
Try running a repair permissions. Maybe its as simple as bad permissions.

Hi Dylan,
you only need to quote the font to escape spaces or characters in the font name that would be interpreted as
part of the command.

The Arial font should not need to be quoted?

You could be right. But I think you might always have to do that because Arial didn’t work for me until I single-quoted it.

Hi mark,

Thanks for your answer, you are absolutely right. It must have something to do with the fonts in general, because it also happens with a completely new user account. I already cleaned every possible font cache on my system and removed font duplicates with the Font Book, but it didn’t solve the problem so far.

Now I am going to deactivate all fonts except the system fonts and try again.

Best regards from cloudy Berlin,

Martin

Just for the record: mark hunte was right, the problem was introduced by a corrupt Font Book database.

After deinstalling all my user fonts, deleting all font caches and reinstalling the Font Book app, I am happy to say that the textutil command works once again.

Best regards,

Martin