For the first angle of attack, I decided that for my first project, there'd be a certain number of times that the app could be opened. So I thought that the best thing would be to save the amount of times opened in a preferences file. I realised then that anyone could easily open the preferences file and change the number again, so I'm now not sure if that's the best approach. Here's my attempt at the end (For the last ten minutes I've been juggling lines, so it probably doesn't make much sense now, but gives the idea of what I was trying to achieve).
Code: Select all
on preOpenStack
put the effective filename of this stack into tStackPath
set the itemdel to "/"
delete last item of tStackPath
set the itemdel to comma
set the defaultfolder to tStackPath
if tCount <16 then
put the text of field "CountUp" into tCount
put tCount + 1 into tCount
put tCount into line 1 of URL ("file:preferences.txt")
put tCount into field "CountUp"
put the text of field "CountUp" into line 1 of URL ("file:preferences.txt")
put line 1 of URL "file:preferences.txt" into field "CountUp"
end if
if tCount = 15 then
set the enabled of button "Try" to false
end if
end preOpenStack
Apologies for such a long post and so many questions but if anyone could lead me out of this fog, i'd be most grateful, thank you!
