Author Topic: Attach Script to Context Sensitive Menu?  (Read 404 times)

Derek

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
  • Scribus User
Attach Script to Context Sensitive Menu?
« on: January 26, 2018, 02:19:32 pm »
I'm new to Python (and scripting for Scribus) so at the start of a couple of learning curves.

I'd like to write a script which can be used to flag workflow in the document I'm editing (a monthly magazine with a lot of tracking to do between editions). The basic script would:

1) Save the current layer
2) Switch to the "Workflow" layer
3) Add a text frame containing "OLD", "KEEP", "QUERY", "WIP", or "NEW" in appropriate colours/fonts/rotation at the cursor position (hence wanting to run the script from the context sensitive menu)
4) Switch back to the saved (current) layer.
 
I'm currently doing this manually. I'd like to speed up the process a little.

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1432
  • Karma: 19
    • the graphics lab
Re: Attach Script to Context Sensitive Menu?
« Reply #1 on: January 26, 2018, 02:47:44 pm »
not possible for now, sorry

a different approach (which might even be faster): you could try to find out if pyqt allows you to capture the clicks... and have a script that captures four clicks and adds the frames there...

you will probably need to "enable extension scripts" in the preferences to have a chance to get it to work..

Derek

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
  • Scribus User
Re: Attach Script to Context Sensitive Menu?
« Reply #2 on: January 27, 2018, 09:50:11 pm »
Thanks. I'll take it slowly for the moment.

I now have a series of scripts (one for each stage) which speed things up a bit. There's room for improvement which I'll look at later as my knowledge grows.

As it's my first* Scribus / Python script, it's very straightforward, and could do with some tidying up I'll not post it here, yet. Hopefully I'll get back to it before I completely forget what on Earth I was thinking. If/when I do tidy/improve it I'll post it here.

* I didn't even write a 'Hello World!'

 

palmate