Saving data to a file
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Saving data to a file
I want to save data from an array to
a text file.
I have the file name made up of a text string and
the result of the "seconds" command plus ".txt"
However I can find a way to make this work in
the usual way such as
put url ("file:" & "numbers.txt") into myData
put myData & "27," into myData
put myData into url ("file:" & "numbers.txt")
Any help appreciated.
a text file.
I have the file name made up of a text string and
the result of the "seconds" command plus ".txt"
However I can find a way to make this work in
the usual way such as
put url ("file:" & "numbers.txt") into myData
put myData & "27," into myData
put myData into url ("file:" & "numbers.txt")
Any help appreciated.
Life is just a bowl of cherries.
Saving data to a file
Noel
Thanks for the tip.
The problem is, I think, that the file
name I want to use isn't "numbers.txt"
but something like "fred1234.txt" and
it's only available in a variable.
BTW the code I posted above works
for "numbers.txt".
Thanks for the tip.
The problem is, I think, that the file
name I want to use isn't "numbers.txt"
but something like "fred1234.txt" and
it's only available in a variable.
BTW the code I posted above works
for "numbers.txt".
Life is just a bowl of cherries.
Can any object do this...
Thanks Tim.
Do you know the magic to make Rev
put this file into the same directory
as the app which makes it?
Just an't get my old brain to figure
this out!
Do you know the magic to make Rev
put this file into the same directory
as the app which makes it?
Just an't get my old brain to figure
this out!
Life is just a bowl of cherries.
Here is a little chunk of script that will output the data into a file in the same directory as the engine is running from :
local tFullEnginePath
local tEngineFolder
set the itemdel to ":"
put item -2 to -1 of the address into tFullEnginePath
set the itemdel to "/"
put item 1 to -2 of tFullEnginePath & "/" into tEngineFolder
put myData into URL("file:" & tEngineFolder & "fred" & the seconds & ".txt")
Hope this is what you were after.
Regards,
Tim.
local tFullEnginePath
local tEngineFolder
set the itemdel to ":"
put item -2 to -1 of the address into tFullEnginePath
set the itemdel to "/"
put item 1 to -2 of tFullEnginePath & "/" into tEngineFolder
put myData into URL("file:" & tEngineFolder & "fred" & the seconds & ".txt")
Hope this is what you were after.
Regards,
Tim.