LM_String What's happening?

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
strider2000
Posts: 506
Joined: Sat Mar 07, 2015 5:14 pm
Contact:

LM_String What's happening?

Post by strider2000 »

Can anyone tell me why

Code: Select all

	print(self.moho.document:StyleByID(0).fName:Buffer())
	print(self.moho.document:StyleByID(0).fName:Buffer())
works, but

Code: Select all

	local style = self.moho.document:StyleByID(0)
	print(style.fName:Buffer())
	print(style.fName:Buffer())
complains that fName is a nil value on the second print? I'm not really trying to print it twice. I'm renaming styles, but I noticed that

Code: Select all

       style.fName:Set()
was failing with fName being nil if I did a

Code: Select all

       style.fName:Buffer()
before it.
Post Reply