Page 1 of 1
Save as dialogue for field contents
Posted: Fri Mar 13, 2009 8:05 pm
by Preston Shea
What is the "save as" equivalent of "ask file" for the user to save the contents of a field as a text file. and choose the location for the file?
Posted: Fri Mar 13, 2009 8:17 pm
by gyroscope
Hi Preston
Something like:
Code: Select all
on exportText
ask file "Name the export file:" with "ISaGo.txt"
if it is empty then exit exportText
put it into savedTextPath
put field "FieldAll" into ResultList
put ResultList into url ("file:" & savedTextPath)
end exportText
Would do the trick. HTH.

Posted: Fri Mar 13, 2009 11:22 pm
by SparkOut
Yay, Jan, you've started a meme!
Posted: Fri Mar 13, 2009 11:37 pm
by gyroscope
I borrowed Jan's meme! (Didn't meme to)

Posted: Sat Mar 14, 2009 10:05 am
by SparkOut
I did! I blatantly stole it.
Posted: Sat Mar 14, 2009 10:27 pm
by Preston Shea
I have no idea what a meme is, but thanks very much for the nice function to save a text field as a file.
How do I insert some text into the midst of a field of text? I know how to use the clickChunk to get the position where I want to insert text, but how do I move the rest of the text over (I don't want to replace it)?
Thanks again for all your help.
Posted: Sat Mar 14, 2009 11:26 pm
by SparkOut
Preston Shea wrote:I have no idea what a meme is, but thanks very much for the nice function to save a text field as a file.
How do I insert some text into the midst of a field of text? I know how to use the clickChunk to get the position where I want to insert text, but how do I move the rest of the text over (I don't want to replace it)?
Thanks again for all your help.
Wikipedia will give a more technical definition, but for the simple purposes, a meme is:
- An idea that, like a gene, can replicate and evolve.
A unit of cultural information that represents a basic idea that can be transferred from one individual to another, and subjected to mutation, crossover and adaptation.
A cultural unit (an idea or value or pattern of behavior) that is passed from one generation to another by nongenetic means (as by imitation); "memes are the cultural counterpart of genes".
Jan (Schenkel) is one of the icons on this forum and typically signs off his helpful contributions with "HTH" = "Hope That Helps".
I started to do the same (sometimes with a credit to Jan and acknowledgement that I'd "stolen" the signoff from him) and I was amused to see gyro do the same this time.
Anyway, if you're using the clickChunk you will find the char range that's selected. If you note the first char position of the clickChunk, you can replace that with the entire new text (and the original char in that position) thus:
Code: Select all
put word 2 of the clickChunk into theChar
put theNewText & char theChar of field "targetField" into char theChar of field "targetField"
This will replace the single char at the start of the clickChunk with the whole new text plus the original single char (so you may need to add spaces etc but this will give you an idea). There are lots of ways to tackle a cat-skinning project in Rev though.
Posted: Sun Mar 15, 2009 10:56 am
by Preston Shea
My thanks again for the meme explanation and clickChunk cat skinner. The latter is just what I need; the former an interesting concept that I want to think about some more. You have been most kind.