Saving data to a file

Discuss your Lua playlist, album art and interface scripts.
vanbassum
New Cone
New Cone
Posts: 2
Joined: 20 May 2023 00:26

Saving data to a file

Postby vanbassum » 20 May 2023 00:31

Hello,

I am completely new to VLC plugins and don't have mutch experience using lua.
That beeing said, I did manage to create a plugin for my purposes exept for one detail.
I would like to save some data to a CSV file.
What ive tried so far is the following:

Code: Select all

function SaveConfirm() local f = vlc.io.open("C:/hello.txt", 'w') f:write("Hello, world!") f:close() end

Its just that nothing is happening, and I also don't have a clue how to get error messages.
Any suggestions?

Also, it would be amazing if you could show a 'safefiledialog' so users can select a place to save their file. Any idea if thats possible?

roland1
Blank Cone
Blank Cone
Posts: 44
Joined: 01 May 2014 16:49

Re: Saving data to a file

Postby roland1 » 20 May 2023 14:25

hi,

Code: Select all

local f = io.open("C:/hello.txt", 'w') -- Messages -------- msg.dbg( [str1, [str2, [...]]] ): Output debug messages (-vv). msg.warn( [str1, [str2, [...]]] ): Output warning messages (-v). msg.err( [str1, [str2, [...]]] ): Output error messages. msg.info( [str1, [str2, [...]]] ): Output info messages. -- Dialog ------ -- Create a new UI dialog, with a human-readable title: "My VLC Extension" local d = vlc.dialog( "My VLC Extension" ) -- Create an editable text field, in order to read user input. d:add_text_input( text, ... )
See, https://github.com/videolan/vlc/blob/ma ... README.txt
Also there is some vlc Lua addon, which writes song info to text file.


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 8 guests