Author Topic: Bacth scripts location?  (Read 5817 times)

0 Members and 1 Guest are viewing this topic.

JMLobert

  • Member
  • **
  • Posts: 14
    • View Profile
Bacth scripts location?
« on: 2018-03-19 21:56:28 »
Two questions:

1) where does T+ 10 store batch scripts?

2) Can I still use scripts created with T+ Vs 7? Extension .tpb

I copied all my old scripts into user\app data\roaming\T+\batches, but the program doesn't seem to see or be able to use them. I restarted the program after copy.

Thanks - Jurgen

Daan van Rooijen

  • Administrator
  • Sr. Member
  • *****
  • Posts: 933
    • View Profile
Bacth scripts location?
« Reply #1 on: 2018-03-19 23:45:30 »
> 1) where does T+ 10 store batch scripts?

Look under Options | Preferences | Schemes & Sets, it depends on your setting for Batch Processing sets there.
 
> 2) Can I still use scripts created with T+ Vs 7? Extension .tpb

Sadly, no.

The new format (as of TP8) uses an extension of ".tp_batch"
I'm volunteering as a moderator - I do not work for Cerious Software, Inc.

JMLobert

  • Member
  • **
  • Posts: 14
    • View Profile
Bacth scripts location?
« Reply #2 on: 2018-03-20 13:03:33 »
Thanks Daan!

mschnell

  • Full Member
  • ***
  • Posts: 98
    • View Profile
Bacth scripts location?
« Reply #3 on: 2018-05-06 01:34:34 »
Ts there (finally) a usable description on how to do "extensions" in Python ?

-Michael

Daan van Rooijen

  • Administrator
  • Sr. Member
  • *****
  • Posts: 933
    • View Profile
Bacth scripts location?
« Reply #4 on: 2018-05-06 02:03:32 »
> Ts there (finally) a usable description on how to do "extensions" in Python ?

Nothing new that I know of..

How to run a python script from within TP was mentioned in this message: http://forums.cerious.com/forum/index.php?id=484
Scripts used by TP are in the Python\Lib\thmpls\ subfolder of your ThumbsPlus program folder - maybe they can provide some insights in how scripting for TP works.

I was looking at (in) the file tpcmd.py and noticed this line: "For implementing your own Python scripts as commands, please see tpuser.py". Unfortunately, this tpuser.py is nowhere to be found. Maybe you can ask Laura about it?
I'm volunteering as a moderator - I do not work for Cerious Software, Inc.

mschnell

  • Full Member
  • ***
  • Posts: 98
    • View Profile
Bacth scripts location?
« Reply #5 on: 2018-05-06 02:25:56 »
I came to the same conclusion and I did ask ages ago :( .

Moreover, while it might be possible to reverse-engineer, from the Python files provided, how things can be done, I would need to provide menus etc to "my" users to make the extensions usable for them.  I seem to remember that I found that there are some files that define the menus and hence might be extended accordingly, but I don't suppose this is decently possible without any instruction.

Being able to do Python extensions, for me is the only reason to convert my users from TP7 to a new version, which would be a major task regarding the completely full and hence not easily convertible  database, the multiple scripts and Web gallery creating files an not really foreseen differences in usage (e.g. managing annotations).

-Michael

mschnell

  • Full Member
  • ***
  • Posts: 98
    • View Profile
Bacth scripts location?
« Reply #6 on: 2018-05-06 02:43:08 »
In fact the file "thumbs8.py" that comes with the "thumbs_py_update_0001" package provides some insight:

# thumbs8.py is imported when T+ starts up. Its main goal at this point is to align .py routines with menu selections.
# for example, importing pie.py will both define the routes for database export and import, and call an internal routine
# which sets them up as on the menu: _tp.set_command(id, python_cmd_string)
#
# Brute force for now: the commands are added to the File|Python menu, unless the ID already is on a menu, in which case
# it is replace. Either can be moved around by the user. In the future, we need to be able to place the items where
# desired, using command ids not already in use.



-Michael

mschnell

  • Full Member
  • ***
  • Posts: 98
    • View Profile
Bacth scripts location?
« Reply #7 on: 2018-05-06 02:50:42 »
e.g. the pie.py file provided in the same package does:


_tp.set_command(20000, 2055, u"pie.tp_export()", u"Export DB", u"Export database tables to a text or XML file" )
_tp.set_command(20001, 2056, u"pie.tp_import()", u"Import DB", u"Import database tables from a text or XML file" )

and with that creates two entries in the "file" menu.

Really good to have this example....

-Michael

mschnell

  • Full Member
  • ***
  • Posts: 98
    • View Profile
Bacth scripts location?
« Reply #8 on: 2018-05-06 03:12:25 »
Maybe there are some more helpful Python scripts in http://www2.cerious.com/binaries/cerious/python/ ?!?!?!?

-Michael

mschnell

  • Full Member
  • ***
  • Posts: 98
    • View Profile
Bacth scripts location?
« Reply #9 on: 2018-05-06 03:31:56 »
unfortunately this does not seem to work by simply moving pie.py and thumbs8.py to the .....\lib\thmpls folder :(

this file also states:

# print 'WE LIEK PIE (and noodels)!'

In fact we would like it, it we were able to make acquaintance ...

-Michael