WP SET A. expects different kind of "range", depending on the attribute type.

for example,

// a regular range to specify where to insert the image
$range:=WP Create range($wp_l;wk end text;wk end text)

// insert the image in range
WP INSERT PICTURE($range;$data;wk append)

// the URL is a property of the regular range
WP SET ATTRIBUTES($range;wk link url;"...")

// the size is a property applies to the "picture" reference, not the range
$insertedImage:=WP Create picture range($range)
WP SET ATTRIBUTES($insertedImage;wk width;"...pt")

now, in your case, you are counting on "wk image"
to changes the data for an image that already exists in the document.

so you keep the picture reference returned from Add picture
but you can't just store for later use,
because it is not a static JSON structure,
it is a reference to an instance of 4D Write Pro
which is destroyed when you unload the form.

if this is an inline picture,
maybe you can construct a regular range (Create range) based on start/end,
then a picture range (Create picture range=Get pictures).

but it sounds like this is an anchored picture (because you mention Add 
picture),
which is not bound to any position in text.

(if it is not an anchored picture, it would make more sense to use INSERT 
PICTURE as shown above)

since it is not possible to converted an inline imaged to anchored,

http://doc.4d.com/4Dv16R6/4D/16-R6/4D-Write-Pro-Attributes.300-3605889.en.html

and only inline images can be an ST expression,
it seems anchored images are pretty much static.

I must say it would be difficult to manipulate an existing anchored image 
without Get elements or Get element by id (v17).

http://doc.4d.com/4Dv16R6/4D/16-R6/Handling-pictures.200-3624743.en.html

2018/06/11 12:18、JOHN BAUGHMAN via 4D_Tech 
<[email protected]<mailto:[email protected]>> のメール:
how can I use WP SET ATTRIBUTES



**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to