If the actual file path is the same, apart from the difference in filemac / filewin, try using this calculation in your Set Variable script step in replace of "filemac:" and it should then work.
If ( Abs ( Get ( SystemPlatform ) ) = 1 ; "filemac:" ; "filewin:" )
Otherwise you could use the same calculation to extent to the whole path if required.
With the Get ( SystemPlatform ) function the values returned are 1 or -1 for a Mac and -2 for a PC.
I hope this helps
OK, so I set this up with the following script steps:
If [Abs (Get (SystemPlatform)) = -2]
Set Variable [$Filename: Value: "filewin:// My location "& Substitute (TrCr Spring 2008: FullName;" ":"-")&"IntEval.pdf"]
ElseIf [ [Abs (Get (SystemPlatform)) = 1]
Set Variable [$Filename: Value: "filemac:/ My location "& Substitute (TrCr Spring 2008: FullName;" ":"-")&"IntEval.pdf"]
Save Records as PDF [Restore; No dialog; $Filename; Records being browsed]
I initially used Save as Pdf. script step to get an accurate filepath from the PC and copied it directly from the script step to the set variable script step so that I could ensure that the location was not the problem.
I can not get the Save as Pdf from the PC to work. It keeps giving me an error that I can not save to this location. I can save a file from the menu bar Save as Pdf and navigating to the location with not trouble but the script step with the variable setting the filepath will not work. Has anyone else experienced this problem???
Thanks in advance for any help!
Absolute value cannot be a negative number, so your test fails. Probably want to omit "Abs" from the IF statement for the Windows platform.
GREAT!!! Now that part works.......
OK, so now I want the variable to change if it is a specific year and save to the desktop. It works for the MAC, but not for the PC with the following:
set variable [$FILEname; value:Get ( DesktopPath )& Substitute ( TrCr Spring 2007 Old::Full Name; " " ; "_" ) & "TC.pdf"]
Is there a different set of script steps that I should be using for a PC to get the desktop location?? It tells me that the FILEname can not be saved to this location.
I like to break things out for easy reading:
Set Variable [ $prefix ; If ( Abs( Get( SystemPlatform ) ) = 1 ; "filemac:" ; "filewin:" ) ] Set Variable [ $Filename ; Substitute( TrCr Spring 2008: FullName;" ":"-" ) & "IntEval.pdf" ] Set Variable [ $FilePATH ; $prefix & "My location" & $Filename ] Save Records as PDF [ Restore; No dialog; $FilePATH ; Records being browsed]
Aside from the Abs error, I noticed you had two slashes in the filewin path vs. one in filemac. If that's needed, just add it to the $prefix. And you have a space after "My location" which may not be intentional.
Edit: never mind, I see you got it working, glad to hear it.
OK, so it appears that the error was due to the fact that the computer this user was working on did not recognize the font in the document. SO, now that I have it working to save to the right location, I try to open the document and get this error from my MAC:
There was an error opening this document. There was a Macintosh system error (-5000).
AND this error from my parallels Windows Environment:
There was an error opening this document. Access denied.
The user can open the document with no trouble, but I, on my MAC ( and in my parallels Window environment) can not access the document. Any ideas on why and how I can fix it?????
OK, so I have found that this is a problem with FM 11 thru a report a bug topic here on this forum, and read about the solutions BUT now can not get the solution to work OR find the page again...... UGH (found it!!)
Here is what I can use help with now:
Using FMP 11 on MAC OSX 10.5.8 on a hosted DB from Windows 2003 FMS V10
I am feeling pretty stupid here but need some help.......I have a user using FMP11 on this hosted Db that has been having trouble producing a .pdf that is viewable to others See my posts here: http://forums.filemaker.com/posts/445295eee8
ok, so I tried these solutions with no success :
Set Variable [$_myFileName; "filewin:/F:/foo/bar/myfile.pdf"] //Variable to pass to Save Records as PDF
Save Records as PDF [$_myFileName] //Do the Save
Set Variable [$_fileToFix; Right($_myFileName;Length($_myFileName)-9)] //removes preceding "filewin:/" text from saved path above
Set Variable [$_fixCommand; "cmd /c icacls \"" & $_fileToFix & "\" /reset" //gives me a string that reads: cmd /c icacls "F:/foo/bar/myfile.pdf" /reset
Send Event ["aevt";"odoc";$_fixCommand] //the call to the windows command prompt (Send Event -> Open Document) which fixes the file.
and the shorted version:
Send Event ["aevt";"odoc";"cmd /c icacls \"" &Substitute ( $FilePath; ["filewin:" ; ""] ; ["/" ; "\\"] ) & "\" /reset"]
I am making the script changes on my MAC and have never used Send Event before. When I open the send event script step I have chosen Open Document and entered a calculation with the statements as well as tried the do script option with the statement in it.
It ends up looking like:
Set Variable [$filetofix; Value:Right($FILEname;Length($FILEname)-10)]
Set Variable [$fixcommand; Value:"cmd /c icacls \"" & $filetofix & "\" /reset"
Send Event ["<unknown>" ;"aevt";"odoc";$fixcommand]
What I am REALLY unsure of is that it asks me to choose a target application. What would this be??? I am not on the server that FMS V10 is on and because I am on a Mac I can not open the windows command prompt..... Can anyone help me thru this so that my user can save the .pdf's that she needs to from her location??? ANY help would be appreciated!!!
I use this script step on a windows system with no trouble:
Set Variable [$Path ; Value: "file:" & Get ( DesktopPath ) & "filename.PDF"]
I think this will work on the Mac also. What you have to look out for is to make sure you don't use any illegal characters such as \ in the file name.
I got the save to the desktop working AND the save to a specific location from wither platform. Now when the user saving from a PC to a file share saves a .pdf no one but them can open it. This is where it goes back to the other post http://forums.filemaker.com/posts/445295eee8. I believe that the permissions that the PC gives the document when using the save as .pdf script step, does not allow any others to view the document on that file share. I will have the user do the update for FM V11.02 and hope that it fixes the problems......
If they are saving the PDF, to a shared directory, then indeed this is the bug described in the other link:
And the updater is supposed to fix that issue.