Open a File in Seamonkey Composer

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

Open a File in Seamonkey Composer

#1 Post by s243a »

Create the short script

/usr/local/bin/composer

Code: Select all

#!/bin/sh
seamonkey -edit "`readlink -f $1`"
Now say I have a file called index.html. If I'm in that folder [1], I can type

Code: Select all

composer index.html
to open the file. Next we would like to be able to right click an item and select open with composer.

If you copy the file

Code: Select all

/usr/share/applications/seamonkey.desktop
and rename it

Code: Select all

/usr/share/applications/composer.desktop
and replace the part after the "=" sign where it says exec with "composer" as follows:

Code: Select all

[Desktop Entry]
Name=Seamonkey
GenericName=Seamonkey Web Browser
X-GNOME-FullName=Seamonkey Web Browser
Exec=composer
Icon=/opt/seamonkey/chrome/icons/default/default48.png
Terminal=false
Type=Application
Categories=X-Internet-browser
then one would think that we can just drag this file into the folder [2]

Code: Select all

~/.config/rox.sourcefordge.net/SendTo
to make this script work when we right write click the file.

However, It doesn't quite work. I seem to get the path twice:

Code: Select all

The file /root/spot/PT/s243a/recomendations-old-hardware/item216383838%0A/root/-%0A/root/Recommendations%0A/root/For%0A/root/Old%0A/root/Hardware.html cannot be found. Please check the location and try again.
I'll try to fix this and report back.

Notes
---------------------
1. You can get a terminal to a local folder by pressing the tilda sign "~" when in that folder in the rox file manager.
2. As an alternative to navigating to the folder "~/.config/rox.sourcefordge.net/SendTo" one can right click on the file, then select "sent to" and then select customize. This will open a folder where you can put scripts that will be called when you right click on the file. Normally one would put a symbolic link to the script in this folder rather then the entire script in order to avoid duplication.

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#2 Post by s243a »

The issue was that I had spaces in my file name. You can fix this by setting the Internal Field separator to the empty string:

Code: Select all

IFS=''
here is the full script:

Code: Select all

#!/bin/sh
Old_IFS="$IFS"
IFS=''
seamonkey -edit "`readlink -f $1`"
IFS="$Old_IFS"
Note that it probably isn't necessary to reset the internal field separator since it is only set to the empty string for the context of this script anyway,

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#3 Post by tallboy »

Doesn't it feel good when you can answer your own questions and correct any mistakes? :lol:
True freedom is a live Puppy on a multisession CD/DVD.

Post Reply