Foot notes in exported documents?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10220
Joined: Fri Feb 19, 2010 10:17 am

Re: Foot notes in exported documents?

Post by richmond62 » Sun Nov 09, 2025 1:34 pm

This worked:

Code: Select all

on mouseUp
  ask file "Choose where you wish to export your text"
  if the result = "cancel" then
  exit mouseUp
  else
     put fld "pada2" into url("file:" & it & ".html")
     set the itemDelimiter to slash
     set the defaultFolder to item 1 to -2 of the longFilePath of it
  end if
  end mouseUp
field 'pada2" contains

<footer>
<p>© 2025 MyWebsite. All rights reserved.</p>
</footer>

what is NOT clear is how to combine that with another field's content.

SparkOut
Posts: 2961
Joined: Sun Sep 23, 2007 4:58 pm

Re: Foot notes in exported documents?

Post by SparkOut » Sun Nov 09, 2025 6:16 pm

Did you try the stack I posted with the rtfText template? It has a basic template included. As long as you aren't doing extensive text colorization [sic] it should be simple to output what you want. Even if you are, it could be worth delving deeper into rtf anatomy to make that possible too, which I would try if you actually expected to use it.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10220
Joined: Fri Feb 19, 2010 10:17 am

Re: Foot notes in exported documents?

Post by richmond62 » Sun Nov 09, 2025 6:33 pm

That threw a 'bluey':
-
SS 2025-11-09 at 19.31.33.png

SparkOut
Posts: 2961
Joined: Sun Sep 23, 2007 4:58 pm

Re: Foot notes in exported documents?

Post by SparkOut » Sun Nov 09, 2025 7:48 pm

I already imported a placeholder stack. That was commented out until you want to go and find any template you might have made.

As it stands without any alteration the stack uploaded should use the basic template imported already and put the text of the header field into the rtf document header, the rtfText of the body field into the main body of the document and the text of the footer field into the rtf document footer, as indicated in the images uploaded.

SparkOut
Posts: 2961
Joined: Sun Sep 23, 2007 4:58 pm

Re: Foot notes in exported documents?

Post by SparkOut » Sun Nov 09, 2025 7:51 pm

rtf stack with template.png

SparkOut
Posts: 2961
Joined: Sun Sep 23, 2007 4:58 pm

Re: Foot notes in exported documents?

Post by SparkOut » Sun Nov 09, 2025 7:58 pm

This is the output file generated, which will (unless altered in the script) be placed in the documents folder.
Delete all the guff after the .rtf filetype extension
Attachments
RichmondsDocument_1762639907.rtf.changeback to rtf filetype.zip
(54.29 KiB) Downloaded 8 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10220
Joined: Fri Feb 19, 2010 10:17 am

Re: Foot notes in exported documents?

Post by richmond62 » Sun Nov 09, 2025 8:06 pm

Thank you: back at that tomorrow as bedtime here in Bulgaria. 8)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10220
Joined: Fri Feb 19, 2010 10:17 am

Re: Foot notes in exported documents?

Post by richmond62 » Mon Nov 10, 2025 10:28 am

SShot 2025-11-10 at 11.27.32.png

SparkOut
Posts: 2961
Joined: Sun Sep 23, 2007 4:58 pm

Re: Foot notes in exported documents?

Post by SparkOut » Mon Nov 10, 2025 7:51 pm

What tool are you using to view rtf files?

Can you make a template rtf file and attach it so I can tell if there's anything strange between Mac/Linux format and Windows?

Klaus
Posts: 14267
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Foot notes in exported documents?

Post by Klaus » Mon Nov 10, 2025 7:54 pm

richmond62 wrote:
Mon Nov 10, 2025 10:28 am
SShot 2025-11-10 at 11.27.32.png
The FILENAME reveals the secret!

HINT: It is NOT a ZIP file actually!

SparkOut
Posts: 2961
Joined: Sun Sep 23, 2007 4:58 pm

Re: Foot notes in exported documents?

Post by SparkOut » Mon Nov 10, 2025 10:55 pm

I can only guess that you need to *extract* the zipped stack before trying to run it within the zip file.
It's only zipped because the forum doesn't allow upload of files of .livecode type, go figure.

Klaus
Posts: 14267
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Foot notes in exported documents?

Post by Klaus » Tue Nov 11, 2025 9:50 am

Please read the filename aloud:
RichmondsDocument_1762639907.rtf.changeback to rtf filetype.zip

Then ONLY rename that file to something like:
RichmondsDocument_but_he_didnt_get_it.rtf

Et voila, it is in fact a NOT zipped RTF file! 8)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10220
Joined: Fri Feb 19, 2010 10:17 am

Re: Foot notes in exported documents?

Post by richmond62 » Tue Nov 11, 2025 10:53 am

Eh, Voila: why do these forums have restrictions of that sort on file uploads?

(I know some other forums that don't)

It doesn't stop the forums being continuously spammed.

Post Reply