Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 03-23-2017, 05:23 PM   #1
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,458
Default Define default path when loading/saving? (GetUserFileNameForRead or other method)

Hello!

Is there a way to define in a script the path where a window will open when wanting to load or save something?
For example, when using GetUserFileNameForRead, how can I specify that I want the window to always open showing, let's say, C:\Reaper?
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)

Last edited by amagalma; 03-24-2017 at 10:00 AM.
amagalma is offline   Reply With Quote
Old 03-26-2017, 11:44 AM   #2
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,458
Default

Anyone? Is this possible?
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 03-26-2017, 12:01 PM   #3
me2beats
Human being with feelings
 
me2beats's Avatar
 
Join Date: Jul 2015
Location: Yekaterinburg, Russia
Posts: 400
Default

Quote:
Originally Posted by amagalma View Post
Is there a way to define in a script the path where a window will open when wanting to load or save something?

It seems there isn't
__________________
My Reapack Repo
Donation
me2beats is offline   Reply With Quote
Old 03-26-2017, 12:45 PM   #4
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

You can cheat it a little bit using the first argument:
Code:
local ret, fn = reaper.GetUserFileNameForRead(reaper.GetProjectPath("").."\\*.*", "Project path:", "")
If you just gave it the project path - C:\Reaper\Projects\Project1 - it would open the window in C:\Reaper\Projects with "Project1" as a suggestion in the filename box. Adding a \ at the end doesn't open a window at all, but if you take the path you want to open and just add whatever random filename you want afterward - C:\Reaper\Projects\Project1\*.* - it'll at least open in the right folder. (Don't forget OS-dependent file separators, obviously)
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 03-26-2017, 01:04 PM   #5
me2beats
Human being with feelings
 
me2beats's Avatar
 
Join Date: Jul 2015
Location: Yekaterinburg, Russia
Posts: 400
Default

Quote:
Originally Posted by Lokasenna View Post
You can cheat it a little bit using the first argument:
Code:
local ret, fn = reaper.GetUserFileNameForRead(reaper.GetProjectPath("").."\\*.*", "Project path:", "")
Wow thanx a lot, it's really cool
__________________
My Reapack Repo
Donation
me2beats is offline   Reply With Quote
Old 03-27-2017, 02:46 AM   #6
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,458
Default

Quote:
Originally Posted by Lokasenna View Post
You can cheat it a little bit using the first argument:
Code:
local ret, fn = reaper.GetUserFileNameForRead(reaper.GetProjectPath("").."\\*.*", "Project path:", "")
If you just gave it the project path - C:\Reaper\Projects\Project1 - it would open the window in C:\Reaper\Projects with "Project1" as a suggestion in the filename box. Adding a \ at the end doesn't open a window at all, but if you take the path you want to open and just add whatever random filename you want afterward - C:\Reaper\Projects\Project1\*.* - it'll at least open in the right folder. (Don't forget OS-dependent file separators, obviously)
Nice!!! Going to try! Thank you very much Lokasenna!!
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:39 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.