When I evaluate this script and hit save then type in "Cool" it saves the file correctly as "Cool.txt" but when I typed in "Cool.txt" it saves the file as "Cool.txt.txt"
Not sure where its bugging out here. Let me know if anyone has the solution.
Thank you.
fn saveTaskList SaveLocation =
(
if (substring SaveLocation 1 (SaveLocation.count-4))==".txt" then
(
TaskList = createFile SaveLocation
)
else
(
TaskList = createFile (SaveLocation+ ".txt")
)
format "Hi" to:TaskList
)
rollout rlSaveText "Save Text"
(
local SaveLocation = undefined
button btnSave "Save"
on btnSave pressed do
(
SaveLocation = getSaveFileName caption:"Save Task List" types:"Text Documents(*.txt)|All|All Files(*.*)|"
if SaveLocation != undefined then
(
saveTaskList SaveLocation
)
)
)
createDialog rlSaveText 150 150
By JokerMartini · 2010-12-06
Swordslayer · 2010-12-07