Skip to content

Saving the last directory a Preset file has been exported to via stateData #432

Discussion options

You must be logged in to vote

Alright I have it and it should work for both PC and Mac.
SInce getParentDirectory() returns an objectID, I prefered using the getFullPathName function, then I remove the last x caracters from the returned string according to the length of the name of the file. This way I have the absolute path until the last folder separator slash for mac or antislash for PC :

	if sLastFileFullPathWoName ~= nil then

        sUserLastFullPathName = sLastFileFullPathWoName..FileName

		fileToWrite = utils.saveFileWindow("Save preset to disk", File(sUserLastFullPathName), "*.syx", true)
		
		sLastFileFullPath = fileToWrite:getFullPathName() -- get the absolute path+filename from dialog box
        sLastFil…

Replies: 4 comments 8 replies

Comment options

You must be logged in to vote
1 reply
@damiensellier
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@Godlike-Productions
Comment options

@Godlike-Productions
Comment options

@dobo365
Comment options

@damiensellier
Comment options

Answer selected by damiensellier
Comment options

You must be logged in to vote
3 replies
@damiensellier
Comment options

@dnaldoog
Comment options

@damiensellier
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants