Page 1 of 1

Running functions within a scripted UI

Posted: May 21st, 2005, 6:16 am
by davestewart
Me again....

I've written a basic help function that reads the first few thousand characters from my script (which is basic readme information) and pops them up in an alert box on screen.

Now, this works fine if I just call the function within the script, but as soon as I assign it to a button handler, the alert dialog pops up empty.

Code: Select all

function help(){
	var f=new File('Kronos Utility 1.0.jsx')
	f.open('r')
	f.seek(243)
	var str=f.read(2127)
	f.close()
	alert(str)
	}

Code: Select all

dlg.btnHelp.onClick=help
I don't get it. Are scripted UIs out to get me!?

Dave

Posted: May 21st, 2005, 6:23 am
by davestewart
Got it....
As soon as the script has finished loading, the Folder.current attribute reverts back to the After Effects default. I'll have to set a variable as the script loads, and take the path from there :)