Since when FolderItem.AbsolutePath has been deprecated (since version 2013r1but worked in 2019r1.1 as deprecated)
FolderItem.CurrentWorkingDirectory returns “/” instead of:
NativePath: /Users/roberto/Documents/XOJO/sampleApp001
ShellPath: /Users/roberto/Documents/XOJO/sampleApp001
Now from my App is not possible to create a folder in the same folder of the App and other stuff
So it’s impossible to get the FolderItem of the Current Working Directory
Could somebody help me to get the complete Path? (as old AbsolutePath)
FolderItem
LR does not know anything about CurrentWorkingDirectory
.
But you can read this ( here text):
The Folderitem.Constructor function can be used to get a FolderItem for an item in the current folder. Simply pass it the name of the item. For example, the following returns a FolderItem for the folder "MyTemplates" in the current folder:
Var f As new FolderItem("MyTemplates")
[quote=458635:@Calvi Tecnologie srl Calvi]Since when FolderItem.AbsolutePath has been deprecated (since version 2013r1but worked in 2019r1.1 as deprecated)
FolderItem.CurrentWorkingDirectory returns “/” instead of:
NativePath: /Users/roberto/Documents/XOJO/sampleApp001
ShellPath: /Users/roberto/Documents/XOJO/sampleApp001
Now from my App is not possible to create a folder in the same folder of the App and other stuff
So it’s impossible to get the FolderItem of the Current Working Directory
Could somebody help me to get the complete Path? (as old AbsolutePath)[/quote]
Its not actually wrong. When not specified, the working directory usually is / in modern OSs.
Try App.ExecutableFile.Parent.
Thank you for help!
Var sampleApptFolder As New Folderitem
sampleApptFolder = App.ExecutableFile.Parent
MessageBox("NativePath: " + sampleApptFolder.NativePath)
Returns me now:
NativePath: /Users/roberto/Documents/XOJO/sampleApp001
Works perfectly!
There are differences between Mac and Windows:
[code]Var AppPath As New Folderitem
#If TargetMacOS Then
AppPath = App.ExecutableFile.Parent.Parent.Parent.Parent
#Else
AppPath = App.ExecutableFile.Parent
#EndIf
MessageBox("NativePath: " + AppPath.NativePath)
[/code]
Returns me now (in both OS):
NativePath: /Users/roberto/Documents/XOJO/sampleApp001
current working dir for macOS mostly makes no sense in a GUI app