Still failed here unfortunately, can't get URLEncode (or URLDecode) to work with the following code:
Code: Select all
on mouseUp
global gLineNumber
set the htmltext of fld "Database" to the DGCustProp of this cd
put fld "Database" into TArchive
--Order the record as 1 line delimited by "#"
put "Title,Notes,Code" into temp
--repeat with i = 1 to number of items of temp
put fld "Title" & "#" after tMyVar
put fld "Notes" & "#" after tMyVar
put fld "Code" & "#" after tMyVar
--end repeat
--Ask to know if new record or changed old:
answer "What will you save?" with "Cancel" or "Changed old record" or "New record"
if it is "Cancel" then exit mouseUp
switch it
case "Changed old record"
put tMyVar into line gLineNumber of TArchive
put TArchive into fld "Database"
break
case "New record"
--Puts the data of the record you just have filled in, after the last line of the archive:
put tMyVar & return after fld "Database"
end switch
--Save the data back to the custom property:
set the DGCustProp of this cd to the htmltext of fld "Database"
end mouseUp
And I've amended the code from the first post in this thread to:
Code: Select all
on mouseUp
global gLineNumber
ask "Find what?"
if it is empty or the result is "Cancel" then exit mouseUp
put it into finne
set the htmltext of fld "Database" to the DGCustProp of this cd
put fld "Database" into TArchive
---------------------original script
repeat with i = 1 to number of lines of TArchive
if finne is in line i of TArchive then
put line i of TArchive into TArchiveLine
put i into gLineNumber
answer gLineNumber
--Puts the data into the various fields:
repeat with y = 1 to 5
set itemdel to comma
put "Title,Notes,Code" into temp
put item y of temp into tField
set itemdel to "#"
put item y of TArchiveLine into fld tField
end repeat
exit repeat
end if
end repeat
end mouseUp
Now if only I knew how to save and place complete chunks of text instead of just the first lines, i.e instead of itemDelimeter I need some sort of Text Chunk delimeter...
Because there are several ways to use custom properties for records, the code above seems closest to what I'm after, i.e Pressing a button saves all the contents (not just the first line though) of 2 or 3 fields then clicking on a list field, automatically puts the relevant text from the custom property back into he fields.
(I'm going down the route of having each button its own custom property and card, i.e all code snippets to do with animation on one card, all snippets to do with controls on another card, etc)
I hope I'm making sense here (it is past midnight again and I might be thinking with one brain cell

). Any help appreciated or perhaps if I uploaded my Script collector stack someone could see what I'm trying to achieve?
Edit: I've decided to upload the stack, RevOnline>gyroscope>My Script Collector
Any help really appreciated, thank you.