script to create shortcut to the LOVE game's save folder
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
script to create shortcut to the LOVE game's save folder
Since love.filesystem contains knowledge about the game's save directory, how would one go about creating a lua script that can generate a shortcut to that directory? It seems like that would save people significant time and energy.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: script to create shortcut to the LOVE game's save folder
What do you mean by shortcut?
Help us help you: attach a .love.
- substitute541
- Party member
- Posts: 484
- Joined: Fri Aug 24, 2012 9:04 am
- Location: Southern Leyte, Visayas, Philippines
- Contact:
Re: script to create shortcut to the LOVE game's save folder
As in a .lnk file or similar. (.lnk is Window's shortcut files).
Currently designing themes for WordPress.
Sometimes lurks around the forum.
Sometimes lurks around the forum.
Re: script to create shortcut to the LOVE game's save folder
The shortcut would be saved in the directory that it´s linking to
Just make a shortcut with this in it
Just make a shortcut with this in it
or%appdata%\LOVE\
Code: Select all
function lazy() -- win love dir to clipboard
savedir = love.filesystem.getSaveDirectory( )
lovedir = love.filesystem.getAppdataDirectory( ) .. "/LOVE"
success = love.filesystem.write( "clipboard.txt", lovedir)
--success = love.filesystem.write( "clipboard.txt", "\%appdata%\\LOVE")
print(lovedir .. " --> clipboard")
os.execute("CLIP < " .. savedir .. "/clipboard.txt")
end
Re: script to create shortcut to the LOVE game's save folder
You can make a Explorer .love shortcut
Code: Select all
function winexplorer() -- opens up win explorer at love save dir
lovedir = love.filesystem.getAppdataDirectory( ) .. "/LOVE"
lovedir = string.gsub(lovedir, "/","\\" )
os.execute("EXPLORER" .. " " .. lovedir)
love.event.quit()
end
- Attachments
-
- savedir(win).love
- opens Explorer at love save dir
- (301 Bytes) Downloaded 55 times
Re: script to create shortcut to the LOVE game's save folder
Note that love.filesystem.getAppdataDirectory returns a UTF-8 encoded string and os.execute may be expecting something different (it's very unlikely that it takes UTF-8 on Windows). Passing the string without modification won't work with paths that have characters outside of ASCII. If you use the %APPDATA% macro instead, then Windows will expand it into the full application data path.
Shallow indentations.
Who is online
Users browsing this forum: Google [Bot] and 7 guests