It is currently April 27th, 2024, 10:39 am

NoPath Script error.

Get help with creating, editing & fixing problems with skins
User avatar
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

NoPath Script error.

Post by Seahorse »

I just noticed that the nopath.lua script (which essentially strips the file path from the front of an image so that only the name of the photo itself i.e. HolidaySnap1.jpg not mydocs/camera/2012/HolidaySnap.jpg) appears in my slide show skin is not working. This is the log error:
Capture.PNG
and this is the lua file which is beyond my ability to fix:

Code: Select all

PROPERTIES =
{

}

function Initialize()

   MeterToUpdate = tolua.cast(SKIN:GetMeter("MeterImageName"), "CMeterString")
   MeasureImageName = SKIN:GetMeasure("Random")

end -- function Initialize

function Update()

   FullImageName = MeasureImageName:GetStringValue()

   Path, ImageName, Extension = string.match(FullImageName, "(.-)([^\\]-([^%.]+))$")
   
   MeterToUpdate:SetText(ImageName)
   
end -- function Update

function GetStringValue()

   return ImageName
   
end -- function GetStringValue
Can someone have a look and see if this is a simple fix, i presume there has been another change to lua. TIA.
You do not have the required permissions to view the files attached to this post.
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: NoPath Script error.

Post by Kaelri »

Are you sure that the [Random] measure exists in your skin? That error usually just means that Lua can't find the measure.

There were also some outdated bits in your script, as you expected. I don't think they're the cause of your problem, but for good form, I've removed them anyway:

Code: Select all

function Initialize()
   MeasureImageName = SKIN:GetMeasure('Random')
end

function Update()
   local FullImageName = MeasureImageName:GetStringValue()
   local Path, ImageName, Extension = string.match(FullImageName, '(.-)([^\\]-([^%.]+))$')
   
   SKIN:Bang('!SetOption', 'MeterImageName', 'Text', ImageName)
   return ImageName
end
User avatar
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: NoPath Script error.

Post by Seahorse »

[Random] is the QuotePlugin measure which is there.

However, the tidied script gives Script: NoPath.lua:2: '(' expected near 'Initialize' which after comparing the old one lead me to this {}function Initialize() and the file name is now appearing again. Thank you Sir. :D
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: NoPath Script error.

Post by jsmorley »

I presume there has been another change to lua.
We work pretty hard to ensure backwards compatibility when we make changes to any part of Rainmeter... If we were really forced to make a change that broke existing skins, it would be in two foot high capital letters in the release notes.
User avatar
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: NoPath Script error.

Post by Seahorse »

Fair enough, but I have not edited the skin or the lua script, esp the latter which makes y head hurt... O.O
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt