The Omni Group Forums

The Omni Group Forums (
-   OmniWeb General (
-   -   Filename problem on download persists in beta (

Clytie 2006-08-23 11:22 PM

Filename problem on download persists in beta
Hi everyone :)

During the 5.5 SP testing, I submitted a [URL=""]bug[/URL] stating that when I downloaded PO files from various sites, Omniweb added a ".txt" extension to the filename, resulting in filename.po.txt instead of filename.po .

I gave details of how this happened, and of sites where it happened. Unfortunately, the problem persists in the betas. A PO file is a gettext translation file, a particular kind of text file, with its own extension: filename.po . The PO template files (as yet untranslated) are filename.pot . This format is very well-known, so it shouldn't come as a surprise to Omniweb.

Is there any progress with this bug? Can I track the progress? I waste way too much time manually changing filenames on download.

Forrest 2006-08-24 08:54 AM

WebKit adds this because the server is sending the file as text.

Handycam 2006-08-24 09:15 AM

The server admin has to set the correct mime type.

I see this downloading Newton packages. Some sites, the PKG file comes down as text with a .pkg.txt ending, but on others, it comes down fine as a binary PKG file. Same thing happens with DMGs and others.

You can also use a renaming utility to help you with problem files. I use A Better Finder Rename, but there re many, some free.

JKT 2006-08-24 03:06 PM

[QUOTE=Clytie]I waste way too much time manually changing filenames on download.[/QUOTE]
Hi Clytie, in the meantime, here's an Automator action to save you some effort in the renaming of your downloads (apologies for the width of the image, but it wasn't very legible at a smaller size):


That is, launch Automator and select [b][I]Finder[/I][/b] in the Library. Select the [b][I]Rename Finder Items[/I][/b] action from the list of Finder actions and drag into the main window. You'll be prompted to add a [B][I]Copy Finder Items[/I][/B] action first as a precaution - up to you whether you do or not, but it isn't necessary.

Input the settings as indicated below then go to the [B][I]File[/I][/B] menu and select [I][B]Save As Plugin...[/B][/I] and pick [B][I]Finder[/I][/B] as the target for the plug-in:


Now, when you download one or more of your .po files and they are converted into .po.txt files, you can simply select them and pick the Automator action from the contextual menu listing when you right click and it will automatically correct the names for you by changing the .po.txt to .po only:


P.S. Don't call your plug-in [b].po.txt to .po[/b] when you save it (i.e. dot po dot txt to dot po) - this will make it invisible to the Finder and it won't show up in the contextual menu item.

P.P.S. This is the type of thing that Automator is excellent for.

Len Case 2006-08-24 03:36 PM

I have to say--we have some of the coolest and most helpful users around!

Another workaround for the issue is to use the "Download to ..." contextual menu item in OmniWeb--that will default to the name you want and *not* change it when the mime-type is noticed.

The current behavior is controlled by NSURLDownload which is an Apple class. Unfortunately it doesn't distinguish between a suggested filename in the response of the server, and it making its own suggestion based on the mimetype so it is hard for us to cleanly resolve this issue in a general way.

Clytie 2006-08-24 11:19 PM

Thankyou very much, each of you, for your offer of help. :)

I am still a little surprised that Omniweb behaves like this. Camino 1.0.2, for example, does not. Downloading the file from one of the same Gnome status pages I listed, gets me via Omniweb and via Camino. Does Camino not use Webkit?

Also, the "Download to..." contextual menu item in Omniweb, which downloads the file to the selected download folder for that site, also adds the "txt" extension to .po files. I've been using this command all the time, since I download individual files so often.

If this were happening on a minority of translation servers, I would take Handcam's suggestion and ask them to reset the MIME type. However, it happens on all the translation servers. That sounds more like a weakness in OW/Webkit than in the widely varying server software used.

In any case, I shall enjoy creating the Automator action. I haven't spent any time with Automator, since I found early on that the first few things I wanted to do weren't supported, but more applications probably have Automator actions now. I'll look into it again. :)

Forrest 2006-08-24 11:30 PM

It also happens in Safari, in my experience. Camino does not use WebKit.

Clytie 2006-08-24 11:35 PM

Ah. My mistake. I thought all three of them used Webkit. ;)

JKT 2006-08-24 11:46 PM

Camino uses Gecko, the Mozilla web rendering engine (also used in Firefox).

Bob Williams 2006-08-24 11:54 PM

Just a quick suggestion to add to what others have already suggested: you can attach a script to a folder, and whenever a new file gets added to that folder, the script will automatically be run on the new file. This way, you don't even need to manually run the script: just save your files from OW, and by the time you switch over to Finder and navigate to the files, the names will have been corrected for you. This type of script is called a Folder Action, and you can find more about it in the Finder's help (switch to Finder, then select Mac Help from the Help menu).

I just checked, and along with AppleScript scripts, you can save Automator workflows as Folder Actions. For more details. pull up Finder help as above and search for "folder actions"; you want the article titled, "Running an Automator action when a folder is changed", which for me is the first article listed in the results.

All times are GMT -8. The time now is 05:45 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.