Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 09-07-2023, 03:27 PM   #31
alastortenebris
Junior Member
alastortenebris began at the beginning.
 
alastortenebris's Avatar
 
Posts: 6
Karma: 10
Join Date: May 2023
Device: Android
This seems to be the case for any command. I tried running "mspaint.exe {inputfile}", which theoretically should open MS Paint and throw an error, but nothing happens. Same with "type {inputfile}", which should just return the text contents.
alastortenebris is offline   Reply With Quote
Old 09-07-2023, 04:28 PM   #32
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,092
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
I uploaded a new version that is more verbose with happens when the command is run. Run the editor from the terminal and post the output here.

Note that I am on a Linux machine and cannot test what happens on Windows, so I am limited on what I can do. Worst case scenario I will make this action Linux only as it is running fine for me.

Last edited by capink; 09-07-2023 at 04:30 PM.
capink is offline   Reply With Quote
Advert
Old 09-07-2023, 07:28 PM   #33
alastortenebris
Junior Member
alastortenebris began at the beginning.
 
alastortenebris's Avatar
 
Posts: 6
Karma: 10
Join Date: May 2023
Device: Android
Command error: Return code is 1 when running command for file: styles/styles.css
stderr: The filename, directory name, or volume label syntax is incorrect.

Any command run throws this error.
alastortenebris is offline   Reply With Quote
Old 09-07-2023, 11:43 PM   #34
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,092
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Try the version attached in this post and see whether it makes any difference.

Last edited by capink; 09-08-2023 at 09:25 PM. Reason: moved zip to first post
capink is offline   Reply With Quote
Old 09-08-2023, 04:33 AM   #35
alastortenebris
Junior Member
alastortenebris began at the beginning.
 
alastortenebris's Avatar
 
Posts: 6
Karma: 10
Join Date: May 2023
Device: Android
Okay, native Windows commands (type) seem to work, but running applications (clean-css) don't, throwing a "stderr: b"'cleancss' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"" error.

On another note, in my quest to have a command that renames html files to xhtml (type {inputfile} > {outputfile}), if I don't arrange the ebook into folders first, the text files are removed from the spine.
alastortenebris is offline   Reply With Quote
Advert
Old 09-08-2023, 01:18 PM   #36
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,092
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by alastortenebris View Post
Okay, native Windows commands (type) seem to work, but running applications (clean-css) don't, throwing a "stderr: b"'cleancss' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"" error.
Try running the command from Windows command line (cmd.exe) using a test css file, and see whether you get the same error or not.

You might need to use the full path of the executable e.g "C:\\Program Files\\CleanCss\\CleanCss.exe", also make sure to double quote if the path contains spaces.

Quote:
Originally Posted by alastortenebris View Post
On another note, in my quest to have a command that renames html files to xhtml (type {inputfile} > {outputfile}), if I don't arrange the ebook into folders first, the text files are removed from the spine.
Not going to go there right now as this is not the intended use for this action. I actually have a plan for a mass renamer plugin that mimics Thunar File Manager renamer, and should integrate with Editor Chains, but it is not coming soon as I don't have the time right now.
capink is offline   Reply With Quote
Old 09-08-2023, 05:30 PM   #37
alastortenebris
Junior Member
alastortenebris began at the beginning.
 
alastortenebris's Avatar
 
Posts: 6
Karma: 10
Join Date: May 2023
Device: Android
Alright got it to work. Apparently calibre does not like things that are in your PATH environment variable. Once I packaged clean-css-cli as an exe and pointed calibre to it, it worked fine.
alastortenebris is offline   Reply With Quote
Old 09-08-2023, 10:04 PM   #38
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,092
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by alastortenebris View Post
Alright got it to work. Apparently calibre does not like things that are in your PATH environment variable. Once I packaged clean-css-cli as an exe and pointed calibre to it, it worked fine.
Strange, as the version I gave you to test (which is now moved to the first post), does clean the PATH variable before passing the command.
capink is offline   Reply With Quote
Old 09-09-2023, 01:02 AM   #39
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,092
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Version 0.9.0

A new version with modifications to the "Run Command". These changes break backward compatibility with chains created with older version of the "Run Command" action. The configuration now forces you to select the binary from the filesystem using a file picker, and supply the arguments on a separate box. This is done to solve problems reported by people using the action on Windows. See screenshot below.
Attached Thumbnails
Click image for larger version

Name:	screen.jpg
Views:	78
Size:	106.3 KB
ID:	203663  

Last edited by capink; 09-09-2023 at 01:06 AM.
capink is offline   Reply With Quote
Old 11-07-2023, 04:34 PM   #40
Wolgan
Enthusiast
Wolgan began at the beginning.
 
Wolgan's Avatar
 
Posts: 26
Karma: 18
Join Date: Jun 2017
Device: Kindle Fire
Exclamation Bug: Transform HTML not respecting scope

When using the Transform HTML action, regardless of what I set (current file, selected files, etc.), it will apply the transform to all HTML files.
Wolgan is offline   Reply With Quote
Old 11-07-2023, 05:50 PM   #41
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,092
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Version 0.9.2
  • Fix: Transform HTML: missing scope setting.
capink is offline   Reply With Quote
Old 11-08-2023, 09:42 AM   #42
Wolgan
Enthusiast
Wolgan began at the beginning.
 
Wolgan's Avatar
 
Posts: 26
Karma: 18
Join Date: Jun 2017
Device: Kindle Fire
Smile

Quote:
Originally Posted by capink View Post
Version 0.9.2
  • Fix: Transform HTML: missing scope setting.
Confirmed issue is resolved!

This forced me to spend some time learning the tag actions built into the plugin and they are amazing! I have a lot of saved rules in the calibre transforms, but I'm definitely going to start converting them over to the action chains version, they're just so flexible!

The action chains plugins are amazing by the way. They literally save me hours per book. So many manual steps and actions are now automated.
Wolgan is offline   Reply With Quote
Old 11-08-2023, 10:44 PM   #43
Wolgan
Enthusiast
Wolgan began at the beginning.
 
Wolgan's Avatar
 
Posts: 26
Karma: 18
Join Date: Jun 2017
Device: Kindle Fire
Is there an equivalent action to the Transform HTML option of "Remove Tag Only"? Where it removes the tag, but leaves the content intact.

For example

Content:
<p><strong>Chapter 1</strong></p>

Match <strong> with a parent of <p>, and remove only the strong tag, leaving:
<p>Chapter 1</p>

So far it's the only thing I haven't found a way to replicate with Tag Actions.
Wolgan is offline   Reply With Quote
Old 11-09-2023, 02:31 AM   #44
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,092
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by Wolgan View Post
Confirmed issue is resolved!

This forced me to spend some time learning the tag actions built into the plugin and they are amazing! I have a lot of saved rules in the calibre transforms, but I'm definitely going to start converting them over to the action chains version, they're just so flexible!

The action chains plugins are amazing by the way. They literally save me hours per book. So many manual steps and actions are now automated.
Enjoy

Quote:
Originally Posted by Wolgan View Post
Is there an equivalent action to the Transform HTML option of "Remove Tag Only"? Where it removes the tag, but leaves the content intact.

For example

Content:
<p><strong>Chapter 1</strong></p>

Match <strong> with a parent of <p>, and remove only the strong tag, leaving:
<p>Chapter 1</p>

So far it's the only thing I haven't found a way to replicate with Tag Actions.
Yes. Use the unwrap action. Attached below is a chain that does what you are asking for. You can add it by: Editor Chains > Add/Modify chains > right click on the chains dialog > import
Attached Files
File Type: zip unwrap strong.zip (632 Bytes, 43 views)
capink is offline   Reply With Quote
Old 11-21-2023, 10:21 PM   #45
bigwoof
Connoisseur
bigwoof began at the beginning.
 
Posts: 83
Karma: 18
Join Date: Jun 2020
Device: Kindle Paperwhite 32G
How do I show the UI for Editor Chains? I have both Editor Chains and Action Chains installed on the latest 7.0 Calibre Windows version.

but I can't find a GUI for editor chains.. There is nothing inside the Toolbar menu and also nothing inside the Favourites plugin -> Customize menu list

I have uninstalled and reinstalled the Editor Chains plugin. Don't want to uninstall Action Chains as I don't want to lose my existing chains..

Thanks!
bigwoof is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Editor Plugin] LanguageTool Doitsu Plugins 17 04-20-2024 02:21 PM
[Editor Plugin] EpubCheck Doitsu Plugins 146 09-07-2023 01:43 PM
[Editor Plugin] - Enabling 'Customize plugin' dialog directly from the Editor thiago.eec Development 7 01-09-2019 08:05 PM
Sample Plugin for the Editor DiapDealer Editor 77 12-10-2014 07:16 AM
Editor plugin question DiapDealer Development 2 07-28-2014 10:23 PM


All times are GMT -4. The time now is 02:42 AM.


MobileRead.com is a privately owned, operated and funded community.