I am hoping that someone can shine some light on my issue as I have been 
working at it for some hours now to no success.

The task is to create a tiddler storing in a field a string, for example, 
ArtworkImages/BJ007.jpg, where the number is an incremental number and the 
text comes from various tiddlers, eg. $:/TLS/imagefoldername,  so it can be 
altered as required..

My code is as follows
<code>
\define artworkurl() <<foldername>><<idcode>><<incremental>><<imagecode>>

\define uniqueid()<<idcode>><<incremental>>

<$set name=foldername value={{$:/TLS/imagefoldername}} >
<$set name=imagecode value={{$:/TLS/imagetypecode}} >
<$set name=newid value= <<uniqueid>> >
<$set name=theurl value=<<artworkurl>> >
<$set name=idcode value={{$:/TLS/idcode}} >
<$set name=incremental value={{$:/TLS/incremental}} >

''Artwork unique ID: <<newid>>''

-----

idcode <<idcode>>

incremental <<incremental>>

foldername <<foldername>>

imagecode <<imagecode>>

newid <<newid>>

theurl <<theurl>>

-----

Artwork title: <$edit-text tiddler="$:/TLS/new-title" tag="input" 
default=""/>

Type: <$edit-text tiddler="$:/TLS/artwork-type" tag="input" default=""/>

Medium: <$edit-text tiddler="$:/TLS/medium" tag="input" default=""/>

Size: <$edit-text tiddler="$:/TLS/size" tag="input" default=""/>

Year created: <$edit-text tiddler="$:/TLS/year-created" tag="input" 
default=""/>

Number in edition: <$edit-text tiddler="$:/TLS/number-in-edition" 
tag="input" default=""/>

Submitted to exhibition: <$edit-text 
tiddler="$:/TLS/artwork-submitted-to-exhibition" tag="input" default=""/>

---

Purchased by: <$edit-text tiddler="$:/TLS/purchased-by" tag="input" 
default=""/>

Date purchased: <$edit-text tiddler="$:/TLS/date-purchased" tag="input" 
default=""/>

Price: <$edit-text tiddler="$:/TLS/price" tag="input" default=""/>

Status: <$edit-text tiddler="$:/TLS/status" tag="input" default=""/>

<$button>
<$action-createtiddler $basetitle="$:/TLS/new-id" $overwrite="yes" />
<$action-setfield $tiddler="$:/TLS/new-id" text=<<uniqueid>> />

<$action-createtiddler $basetitle="$:/TLS/artworkurl" $overwrite="yes" />
<$action-setfield $tiddler="$:/TLS/artworkurl" text=<<artworkurl>> />

<$action-setfield $tiddler="$:/TLS/incremental" text={{{ 
[{$:/TLS/incremental}add[1]] }}}/>
<$action-createtiddler 
     $basetitle={{$:/TLS/new-title}} 
     $template="Artwork Template" 
     tags="Artworks" 
     $overwrite="yes" 
     artwork_id={{$:/TLS/new-id}}
     artwork_url={{$:/TLS/artworkurl}} 
     artwork_numberinedition={{$:/TLS/number-in-edition}} 
     artwork_price={{$:/TLS/price}} 
     artwork_status={{$:/TLS/status}} 
     artwork_yearofcreation={{$:/TLS/year-created}} 
     purchased_by={{$:/TLS/purchased-by}} 
     artwork_medium={{$:/TLS/medium}} 
     artwork_size={{$:/TLS/size}} 
     artwork_price={{$:/TLS/price}} 
     artwork_status={{$:/TLS/status}} 
     date_purchased={{$:/TLS/date-purchased}}
     artwork_type={{$:/TLS/artwork-type}}
     
artwork_submitted_to_exhibition={{$:/TLS/artwork-submitted-to-exhibition}}
/>
<$action-deletetiddler $tiddler="$:/TLS/new-title" />
<$action-deletetiddler $tiddler="$:/TLS/artworkurl" />
<$action-deletetiddler $tiddler="$:/TLS/new-id" />
<$action-deletetiddler $tiddler="$:/TLS/medium" />
<$action-deletetiddler $tiddler="$:/TLS/size" />
<$action-deletetiddler $tiddler="$:/TLS/year-created" />
<$action-deletetiddler $tiddler="$:/TLS/number-in-edition" />
<$action-deletetiddler $tiddler="$:/TLS/purchased-by" />
<$action-deletetiddler $tiddler="$:/TLS/date-purchased" />
<$action-deletetiddler $tiddler="$:/TLS/price" />
<$action-deletetiddler $tiddler="$:/TLS/status" />
<$action-deletetiddler $tiddler="$:/TLS/artwork-type" />
<$action-deletetiddler $tiddler="$:/TLS/artwork-submitted-to-exhibition" />
Add new artwork
</$button>

</code>

The problem is passing the values of  artwork_url and artwork_id into the 
new tiddler. The values stored are: artwork_id is <<idcode>><<incremental>> 
and artwork_url is <<foldername>><<idcode>><<incremental>><<imagecode>> 
instead of their values.

However, displaying the values of the variables  for debugging purposes 
gives:

idcode YB

incremental 20

foldername ArtworkImages/

imagecode .jpg

newid YB20

theurl ArtworkImages/YB20.jpg

These values are as they should be but they are not carried across into the 
action-createtiddler widget. 

I have tried passing the values through the local variables using for 
example, artwork_url=<<theurl>> or through a macro call 
artwork_url=<<artworkurl>> instead of  trying to get the value from the 
temporary tiddler artwork_url={{$:/TLS/artworkurl}} but nothing works.

What am I doing wrong?

bobj

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/cf8c4e88-8d55-40a7-9519-1484f7aa95c7n%40googlegroups.com.

Reply via email to