Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 03-25-2017, 01:36 PM   #1
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default reaper.GetProjectPath returns path + RECORD_PATH from project file

It should return the project path only without retrieving the recording path saved into the project. Or the API should be renamed to GetProjectRecordingPath

test project

test code:
Code:
path = reaper.GetProjectPath(0)
reaper.ShowConsoleMsg(path)
__________________
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-25-2017 at 01:45 PM.
amagalma is offline   Reply With Quote
Old 03-25-2017, 01:48 PM   #2
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

+1

The expected behavior, given that there's no explanatory documentation, is that it should spit out a path to the .rpp.

Ideally it would include a parameter to choose the project path, recording path, or secondary recording path.
__________________
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-25-2017, 02:25 PM   #3
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

Quote:
Originally Posted by Lokasenna View Post
Ideally it would include a parameter to choose the project path, recording path, or secondary recording path.
Great idea!
__________________
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 01-23-2018, 09:59 AM   #4
modraw
Human being with feelings
 
modraw's Avatar
 
Join Date: Oct 2017
Posts: 27
Default

+1 as well - Can we get the recording or media path somehow ? cheers !
modraw is offline   Reply With Quote
Old 01-23-2018, 11:33 AM   #5
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

Similar behaviour with the <Project Directory> shortcut in Media Explorer:

https://forum.cockos.com/showthread.php?t=189884

(which was classified as not a bug but I wouldn't fully agree)
nofish is offline   Reply With Quote
Old 01-25-2018, 08:32 AM   #6
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

+1
It should return all three paths as three returnvalues.

Always annoyed me..
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-22-2020, 01:40 PM   #7
TobyAM
Human being with feelings
 
Join Date: Feb 2017
Location: Hollywood, CA
Posts: 125
Default

If you are like me and want to hack around this but don't want to spend the minute it takes to google, add this to the end:

:gsub("(.*)\\.*$","%1") .. "\"

like

local pro_path = reaper.GetProjectPath(0 , '' ):gsub("(.*)\\.*$","%1") .. "\"

Last edited by TobyAM; 01-22-2020 at 02:03 PM.
TobyAM is offline   Reply With Quote
Old 01-22-2020, 01:55 PM   #8
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,749
Default

The function does return the recording path, as you say. We'll update the API documentation to say this.

You can get the current project name, including path, this way:

Code:
str=""
proj, str=reaper.EnumProjects(-1, str)
reaper.ShowConsoleMsg(str)

Last edited by schwa; 01-22-2020 at 02:06 PM.
schwa is offline   Reply With Quote
Old 01-31-2020, 10:23 PM   #9
TobyAM
Human being with feelings
 
Join Date: Feb 2017
Location: Hollywood, CA
Posts: 125
Default

Awesome, thanks!
Quote:
Originally Posted by schwa View Post
The function does return the recording path, as you say. We'll update the API documentation to say this.

You can get the current project name, including path, this way:

Code:
str=""
proj, str=reaper.EnumProjects(-1, str)
reaper.ShowConsoleMsg(str)
TobyAM is offline   Reply With Quote
Old 12-13-2020, 11:44 AM   #10
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

Quote:
Originally Posted by TobyAM View Post
If you are like me and want to hack around this but don't want to spend the minute it takes to google, add this to the end:

Code:
:gsub("(.*)\\.*$","%1") .. "\"
like

Code:
local pro_path = reaper.GetProjectPath(0 , '' ):gsub("(.*)\\.*$","%1")  .. "\"
thank you, 2 corrections:

_, pro_path = reaper.GetProjectPathEx(0 , '') or pro_path = reaper.GetProjectPath('')

backslash needs escape, was probably eaten up by the forum code
Code:
.."\\"
another method

proj_dir = select(2,reaper.EnumProjects(-1, '')):match("^(.+[\\/])")

Last edited by Buy One; 12-13-2020 at 11:49 AM.
Buy One is online now   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 09:25 AM.


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