I come across a very strange behavior here with Xojo. I have inserted comments in the relevant places! Replace the code in PushButton1.Action in my project from above with the following:
[code]#If TargetMacOS Or TargetLinux
Dim dialog As New SaveAsDialog
Dim output As FolderItem = dialog.ShowModalWithin(Self)
If output <> Nil Then
TempFolder = SpecialFolder.Desktop.Child("foo")
TempFolder.CreateAsFolder
CreateTempFolder(TempFolder)
Dim command, inputPath, outputPath As String
inputPath = """" + TempFolder.NativePath + """"
outputPath = """" + output.NativePath + """"
' This doesn't work correctly. The extra folder "Users/..." will be included.
' command = "cd " + inputPath + "; zip -r -q " + outputPath + " " + inputPath + " *"
' This works correctly, but with a weird command string.
' You can also see it on the Xojo Syntax highlightning.
command = "cd """ + TempFolder.NativePath + """; zip -r -q """ +_
output.NativePath + """ "" + TempFolder.NativePath + "" *"
Shell1.Execute(command)
@Emile Schwarz Did you tried my code? If you wanna add quotes into a string, you need to uses a double quote to get one quote.
I modified the command string and now it works fine:
[quote=432888:@Martin Trippensee]@Emile Schwarz Did you tried my code? If you wanna add quotes into a string, you need to uses a double quote to get one quote.
I modified the command string and now it works fine: