Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I created a Nautilus Action script to change file encoding using recode application.
My action is:

[Desktop Entry]
Type=Action
ToolbarLabel[en_US]=Convert Encoding From Windows-12
ToolbarLabel[en]=Convert Encoding From Windows-12
ToolbarLabel[C]=Convert Encoding From Windows-12
Tooltip[en_US]=Converts file content encoding from Windows-1256 and saves as UTF-8
Tooltip[en]=Converts file content encoding from Windows-1256 and saves as UTF-8
Tooltip[C]=Converts file content encoding from Windows-1256 and saves as UTF-8
Name[en_US]=Convert Encoding From Windows-1256
Name[en]=Convert Encoding From Windows-1256
Name[C]=Convert Encoding From Windows-1256
Profiles=profile-zero;

[X-Action-Profile profile-zero]
SelectionCount==1
MimeTypes=all/allfiles;
Matchcase=false
Basenames=*.srt;
Exec=recode windows-1256 "%F"
Name[en_US]=Default profile
Name[en]=Default profile
Name[C]=Default profile
ExecutionMode=DisplayOutput

The code worked properly for a while but now it fails!
When I set action's ExecutionMode to DisplayOutput it displays this:

Run command:
/bin/sh -c 'recode  windows-1256 "'\''/home/ariyan/a.srt'\''"'

Standard output:


Standard error:
recode: fopen ('/home/ariyan/a.srt'): No such file or directory

it can't find the file while it is there! (When I run the same command in a terminal window it works)
What is the problem ?
Why sh can't find the file?

Thanks

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

The problem was quotes in command!
using recode windows-1256 %F instead of recode windows-1256 "%F" solved the problem!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.