Hi Tom,
Currently there are no commands to create or manipulate stylesheets in WP.
This is how I do it:

Save the document as HTML.
Modify the CSS in the HTML.
Recreate the doc from the HTML

For example, to create and add a new stylesheet:

$cssstyle:="p."+tStyleSheetName+",li."+tStyleSheetName+" { "

$cssstyle:=$cssstyle+"text-align:left"

$cssstyle:=$cssstyle+";-d4-font:'"+$tDefaultFont+"'"

$cssstyle:=$cssstyle+";font-size:"+$tDefaultfontSize

// add other attributes as required

$cssstyle:=$cssstyle+"}"

*WP EXPORT VARIABLE*(WPdoc;$tWPtemplate;wk web page html 4D)

$pos:=*Position*("}p.";$tWPtemplate)

$tWPtemplate:=*Insert string*($tWPtemplate;$cssstyle;$pos+1)

WPdoc:=*WP New*($tWPtemplate)

HTH
Pat

On Tue, 27 Aug 2019 at 18:39, Tom Benedict via 4D_Tech <[email protected]>
wrote:

> I am converting a massive code base from Write Classic to Write Pro. I’m
> down to the final few dozen methods. A few of them have support for Write
> Classic stylesheets as in WR Create stylesheet, WR SET STYLESHEET FONT, WR
> SET STYLESHEET TEXT PROP etc.
>
> What is the recommended approach to doing this in Write Pro? I’ve poked
> around the documentation, 4D Blog, KnowledgeBase but don’t find much. Do I
> need to build my own system to set groups of style attributes?
>
> Thanks,
>
> Tom Benedict
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************



-- 
*************************************************
CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to