3

I use SeaMonkey from MS-Windows 10 and I use it for it's nice (HTML) Composer feature. I do not use it for web browsing. I have setup SeaMonkey's preferences to only open the composer at application startup. When I startup SeaMonkey from the Windows CMD prompt without any command line arguments, it does open up the composer as expected. But when I give a filename as a parameter, it opens up that file in the browser and not in the composer. Is there a way to have SeaMonkey open up the file specified as command line argument to open in the composer? I am trying to script this and hence the need to specify the HTML file as a command line argument.

Rahul Khimasia
  • 908
  • 9
  • 15

2 Answers2

3

For Windows, the command line you're looking for is seamonkey -editor %1 where %1 will be substituted by the URL of the file you are right-clicking on.

Even if you have configured SeaMonkey to launch as Composer (using Èdit > Preferences > Appearance), when you pass a file argument to it on the command line, it reverts to assuming you meant to open it in browser mode, unless you specify otherwise, as above.

See: https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options

To run this command from the Win10 shell (rather than the command line, which you're interested in), see https://stackoverflow.com/a/11882138 for how to add a new item (e.g. Edit) to File Explorer's right-click menu for a certain file type (.html in this case), and how to associate the above command line with it.


Incidentally, for Ubuntu 20.04 Linux running the gnome shell (which is the OS I wanted to alter when I started searching for an answer), you can discover which config file to edit as follows:

$ grep -i seamonkey ~/.config/mimeapps.list 
text/html=seamonkey-mozilla-build.desktop;org.gnome.gedit.desktop;libreoffice-writer.desktop;firefox.desktop;
$ find / -name seamonkey-mozilla-build.desktop 2> /dev/null 
/usr/share/applications/seamonkey-mozilla-build.desktop 
$ cd ~/.local/share/applications
$ cp /usr/share/applications/seamonkey-mozilla-build.desktop .
$ chmod +x seamonkey-mozilla-build.desktop
$ vi seamonkey-mozilla-build.desktop

or substitute your favourite editor for vi. Then change the line starting Exec to:

Exec=seamonkey -editor %u
1

I was looking to do the same thing but from the Send To context menu. My solutions was to create the following batch file which I named composer.bat and put into the "C:\Users\USERNAME\AppData\Roaming\Microsoft\Windows\SendTo" folder.

@echo off    
"C:\PATH\TO\SeaMonkey.exe" -editor "%~1"

This next part is needed only if you don't want to have the command box that launches the batch file visible while you are editing the HTML file in Composer. Create a .vbs script with the following lines. I named the file composer.vbs. Then simply send the target file to that file instead of composer.bat. It will launch composer.bat but hide the command window.

   Set WshShell = CreateObject("WScript.Shell")    
   WshShell.Run chr(34) & "C:\PATH\TO\composer.bat" & chr(34) & " " & chr(34) & WScript.Arguments(0) & chr(34), 0    
   Set WshShell = Nothing