It should be
"filewin:"& Get ( DesktopPath ) & Invoice::Name & ".pdf"
"filewin:"& Get ( /C:/Users/Brunella/Desktop/ ) & Invoice::Name & ".pdf"
this get function returns the file path to the desktop that is valid for the current computer and computer user account. Change user accounts or change computers and it will return a different file path that is valid for that context.
You may find this thread on $Path variables and the script steps that can use them helpful:
I tried with "filewin:"& Get ( DesktopPath ) & Invoice::Name & ".pdf" but I got the same error that's why I thought to try with my real path since I'm the only user of the PC and filemaker run only there so desktop is always in the same path, I had a look at the link you posted.. I see there's a file to extract the correct path I cannot try it now, but I think the path is correct since I'm using it right now to save pdf and manually renaming them after creation. Desktop is not a priority I can put the pdf in a folder if that's the problem in that case should I change DesktopPath with another path? I read about DesktopPath here http://www.filemaker.com/help/12/fmp/html/func_ref2.32.27.html seems written without spaces Get(DesktopPath) I'm totally newby at this stuff so any additional advice will be helpful.
Desktop is the best location to specify for saving a PDF when you are having trouble since this is a location to which the user is nearly guaranteed to have "write" access privileges. I don't think this is due to specifying the desktop folder as the location for the PDF save. More likely there is some other issue preventing it from working and the error message doesn't really do a good job of telling you what is the most likely thing to look for.
If you want to use a literal path instead of the get function, just don't use the get function, just enter the path in quotes.
Two main issues to check:
The path specified in the variable may be incorrect in some small way. (one character wrong is all that this takes). This is where the file that I created in the other thread is useful. You can insert a PDF file from your desktop and then examine the different fields to see at least two different path expressions that will be valid for the inserted PDF and you can then compare that to what you have attempted to use here. You can even copy and paste the path from the field into your script. You need also confirm that the text in Invoice is text that creates a valid file name. Some characters, such as / are not permitted in a file name.
That there is no file at the specified location with an identical file name that is already open on your computer. That will also prevent FileMaker from saving the PDF.