Good day all,
I trying to save RTF in pc file but I cn save my RTF header name but all the time when I open it it empty inside
code
global gEditorField
on preopencard
put "status" into field "statusField"
end preOpenCard
on openCard
put the RTFText of field "editorField" into gEditorField
end openCard
on buttonPushedBack
uploadEditField
end buttonPushedBack
on uploadEditField
if the rtftext of field "editorfield" is gEditorField then
go to card "report"
exit uploadEditField
end if
put field "namefield" into tname
if tname is not in field "listfield" of card"report" then
put "üploading" into field "statusfield"of card "edit report"
put the rtftext of field "editorField"into URL ("file:C:\Users\Live code\Desktop\BPV\report\"& tname & ".rtf")
put cr & tname after field "listfield" of card "report"
put field "listfield" of card "report" into URL ("file:C:\Users\Live code\Desktop\BPV\report\list.txt")
else
put "uploading" into field "statusfield" of card "edit report"
put the rtftext of field "editorField" into url ("file:C:\Users\Live code\Desktop\BPV\report\" & tname & ".rtf")
answer "upload complate"
end if
go to card "report"
end uploadEditField
why it don't save what I write inside the field
thanx
save RTF in file
Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller
Re: save RTF in file
Hi WXT,
1. welcome to the forum!
2. Looks like you discovered a bug!
I also checked this and you are correct, there is a lot of text missing in the resulting file!
I created a bug report:
http://quality.runrev.com/show_bug.cgi?id=16308
EDIT: It just has been confirmed as a bug!
Best
Klaus
1. welcome to the forum!

2. Looks like you discovered a bug!
I also checked this and you are correct, there is a lot of text missing in the resulting file!
I created a bug report:
http://quality.runrev.com/show_bug.cgi?id=16308
EDIT: It just has been confirmed as a bug!
Best
Klaus
Re: save RTF in file
thanx for replaying glad to help by accident 
------
so any help to make it work ?

------
so any help to make it work ?
-
- Livecode Opensource Backer
- Posts: 5598
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: save RTF in file
I think you are making things very complicated.
Here is a stack that took me 5 minutes.
with this script in the button "Export to RTF":
on mouseUp
set the useUnicode to true
ask file "Choose where you wish to export your text"
if the result = "cancel"
then exit mouseUp
else
put the RTFtext of fld "fff" into url("file:" & it & ".rtf")
get the longFilePath of it
set the itemDelimiter to slash
set the defaultFolder to item 1 to -2 of the longFilePath of it
end if
end mouseUp
I have attached the stack so you can play with it.
Here is a stack that took me 5 minutes.
with this script in the button "Export to RTF":
on mouseUp
set the useUnicode to true
ask file "Choose where you wish to export your text"
if the result = "cancel"
then exit mouseUp
else
put the RTFtext of fld "fff" into url("file:" & it & ".rtf")
get the longFilePath of it
set the itemDelimiter to slash
set the defaultFolder to item 1 to -2 of the longFilePath of it
end if
end mouseUp
I have attached the stack so you can play with it.
- Attachments
-
- RTFX.zip
- Here is the stack
- (850 Bytes) Downloaded 73 times