attempt to index global 'os' (a nil value)

Discuss your Lua playlist, album art and interface scripts.
147852369
Blank Cone
Blank Cone
Posts: 55
Joined: 01 Mar 2013 12:18

attempt to index global 'os' (a nil value)

Postby 147852369 » 10 Oct 2014 14:58

Code: Select all

lua warning: Error loading script C:\Program Files (x86)\VideoLAN\VLC\lua\extensions\my_new_extension.lua: ...les (x86)\VideoLAN\VLC\lua\extensions\my_new_extension.lua:60: attempt to index global 'os' (a nil value)
I googled a lot but can't find a solution to resolve my problem.

My extension:

Code: Select all

-- just comments above config = { -- directories must exist! errorLogDestination = os.getenv("UserProfile") .. "\\Desktop\\vlc_dev\\VLC_ERRORLOG.txt", -- where to save error log -- HERE'S LINE NUMBER 60 moveDestination = os.getenv("UserProfile") .. "\\Desktop\\moveDestination", -- in which directory to move files moveLogDestination = os.getenv("UserProfile") .. "\\Desktop\\vlc_dev\\VLC_MOVELOG.txt", -- where to save the selected files for moving deleteLogDestination = os.getenv("UserProfile") .. "\\Desktop\\vlc_dev\\VLC_DELETELOG.txt", -- where to save the selectes files for deletion shellFileDestination = os.getenv("UserProfile") .. "\\Desktop\\vlc_dev\\VLC_MOVE.cmd" -- where to save batch file with commands and paths to move } -- other table .... function descriptor() return { title = "my new extension"; shortdesc = "my new extension"; description = "<h1>my new extension<h1>" .. "hello<br />" .. "hello2"; version = "1.1"; author = "my name"; capabilities = {"input-listener", "meta-listener"} } end function activate() main_gui() -- creates dialog, etc. vlc.msg.dbg("[] activated; collectgarbage(\"count\"): " .. (collectgarbage("count") * 1024)) end
If I commented the os.getenv() lines out, I get the same error in a other function, in which is "os.remove()" ...

Two days ago I didn't have this error. I don't know what I changed?!

Is someone here with an idea? Thanks.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: attempt to index global 'os' (a nil value)

Postby mederi » 12 Oct 2014 20:46

Try to move your config variable into activate() function.

147852369
Blank Cone
Blank Cone
Posts: 55
Joined: 01 Mar 2013 12:18

Re: attempt to index global 'os' (a nil value)

Postby 147852369 » 13 Oct 2014 14:44

That looks bad, but it works. Thanks.


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 5 guests