Tinderbox Forum

Meetup 13 February 2021

VIdeo: https://vimeo.com/512017034

Working file: TBX - Meetup 13FEB21 Simpson Demo.tbx (119.3 KB)

[Admin edit] above file updated for Display Expression code typo described below: TBX - Meetup 13FEB21 Simpson Demo-2.tbx (113.9 KB)

During the video you may have notice that come of my action code was old, that I’d not gotten around to updating my Text Expander. I’ve updated the code, here you go:

FOR IMAGES
<br>^if^(^value($MediaFileName!=""))^<a href="^value($URL)^"><img src="^value($MediaPath("TBXConfigNote"))^^value($MediaDIR("TBXConfigNote"))^^value($MediaFileName)^" ^if^(^value($MediaWidth!=""))^width="^value($MediaWidth)^"^endif^ ^if^(^value($MediaHeight!=""))^height="^value($MediaHeight)^"^endif^></a>^endif^<br>^if^($MediaCaption)^<b>Figure: </b>^value($MediaCaption)^ ^endif^ ^if($MediaSource)^(^value($MediaSource)^)^endif^</br>

FOR VIDEO
Edited for readability:
^if^(^value($MediaFileName)!="")<video width="^value($MediaWidth)^" height="^value($MediaHeight)^" ^if^($MediaPoster!="")poster="^value($MediaPath("TBXConfigNote"))^^value($MediaDIR("TBXConfigNote"))^^value($MediaPoster)"^endif^ controls><source src="^value($MediaPath("TBXConfigNote"))^^value($MediaDIR("TBXConfigNote"))^^value($MediaFileName)^#t=^value($MediaStartTime)^,^value($MediaStartTime+$MediaDuration)^" type="video/mp4"></Video>^endif^<br>^if^($MediaCaption)^<b>Figure: </b>^value($MediaCaption)^ ^endif^ ^if($MediaSource)^(^value($MediaSource)^)^endif^</br>

Here is the Audio as well,

For AUDIO
^if^(^value($MediaFileName)!="")<audio controls><source src="^value($MediaPath("TBXConfigNote"))^^value($MediaDIR("TBXConfigNote"))^^value($MediaFileName)^#t=^value($MediaStartTime)^,^value($MediaStartTime+$MediaDuration)^" type="audio/mpeg"> </audio>^endif^<br>^if^($MediaCaption)^<b>Figure: </b>^value($MediaCaption)^ ^endif^ ^if($MediaSource)^(^value($MediaSource)^)^endif^</br>

Note, I am working on a method to build in a condition that recognizes if a current note has a media path or media directory value. If it does, I’ll have the export code use the local variable, if it does not I’ll have the export code you the note’s config note. I’ve tried using inline conditions for this but it seems to break the URL. I think I need to have the URL constructed first by action code and then pull this in as a variable. I’ll work on this next week.

I get an error:
This note’s $DisplayExpression cannot be parsed:No attribute named $DisplayExpressionCache

You’re right! A great example of inheritance. I had updated the prototype but the note has a local value setting. There was a typo. “Expresion” should have two “ss”, it should be $DisplayExpressionCache. If you fix the “s” that will clear it right up. @eastgate, would you mind updating the file? I can’t edit it.

,

What is the type of $MediaDuration?

Thanks!

Number, but String should work too.

I’ve edited the code typo original TBX and uploaded the fixed version here: TBX - Meetup 13FEB21 Simpson Demo-2.tbx (113.9 KB)

1 Like

As the admin, can you also update the original post so that people who miss this update won’t inadvertently download the old file. No need for them to deal with a typo.

1 Like

Actually I did, see post 1 in thread. I used strikethrough rather than deletion so as to help those who saw the original post. I’m happy to take more of a steer on this if you still think it’s not clear/helpful - as our common goal is the opposite of that. :slight_smile:

Ah…perfect!!! :slight_smile:

Hallo,
just like to know when the next TB-meeting will take place.
On 13 Feb 2021 I had problems to conntect, so I have missed it.

Thank you
Steffi

Welcome to the forum. At present there is a Saturday meet-up usually tea-time in Europe and breakfast on the US west coast. Sometimes there is a midweek meet-up (Wed-Thu) for Pacific Rim folks. Look at old meet-up threads for general timing. New faces are always welcome at the meet-ups.

Hi Mark,

thank you very much. Hope, that I can log in at the next meeting.
Have a good day.
Steffi

1 Like