
Nautilus Action
アプリケーションを使用してファイルのエンコーディングを変更するスクリプトを作成しましたrecode
。
私のアクションは次のとおりです。
[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
コードはしばらくは正常に動作していましたが、今は失敗します。
アクションを設定すると、次のようExecutionMode
にDisplayOutput
表示されます。
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
ファイルはそこにありますが、見つけることができません。(ターミナル ウィンドウで同じコマンドを実行すると動作します)
何が問題なのでしょうか?
なぜsh
ファイルが見つからないのでしょうか?
ありがとう
答え1
問題はコマンド内の引用符でした。の代わりに
を使用することで、問題は解決しました。recode windows-1256 %F
recode windows-1256 "%F"