Running functions within a scripted UI

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
davestewart
Posts: 114
Joined: March 10th, 2005, 5:50 am
Location: London, UK
Contact:

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
davestewart
Posts: 114
Joined: March 10th, 2005, 5:50 am
Location: London, UK
Contact:

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 :)
Post Reply