John Wolf wrote: >I'm about to go nuts with this one... > >I have a program that mounts a server volume, backs up a few items and then >dismounts the volume. I'm converting it to carbon, and unmounting the volume >isn't working as a carbon program. > >The sample below uses applescript to mount and *attempt* to unmount the >volume. What is bizarre is that this applescript code works fine from the >Applescript editor. The volume mounts and unmounts as expected. However, as >part of a FB program, the volume never unmounts. The code originally used >PBVolumeMount and PBUnmountVol. Both the FB Applescript version and the >toolbox version exibit the same behavior... the volume doesn't unmount. John, Here are a few things to try: 1.) Just to hymor me, be sure there are no funky characters in the name of the volume you want to unmount. 2.) Run this little utility to test if the volume is indeed able to be unmounted (no files on the volume currently being used by the OS): '------------ Begin Code ------------- include "Subs AppleScript.Incl" local fn ListEjectableDisks$ dim as OSErr err dim as str255 messageStr route _toAppleScript print "tell application ""Finder""" print "name of every disk of desktop whose ejectable is true" print "end tell" route _toScreen err = usr AppleScriptRun( messageStr ) long if err == _noErr messageStr = messageStr xelse messageStr = Str$( err ) end if end fn = messageStr print fn ListEjectableDisks$ include "Subs Quick Event Loop.Incl" '------------ End Code --------------- 3.) If this test fails, you have a haxie or something that's using a file on the volume you want to unmount. 4.) If you find your volume on the list, this script-- slightly modified from the example you posted-- was tested and worked on my end (I have added some error checking just for test purposes): '------------ Begin Code ------------- include "Subs AppleScript.Incl" dim as OSErr err dim as str255 setVolStr, messageStr, errStr route _toAppleScript print "tell application ""Finder""" print "set theDisk to disk ""MacUpdates""" print "eject theDisk" print "end tell" route _toScreen err = usr AppleScriptRun( messageStr ) long if err == _noErr xelse select case( err ) case -1700 : errStr = "Can't make some data into the expected type." case -1701 : errStr = "Some parameter is missing for <commandName>." case -1702 : errStr = "Some data could not be read." case -1703 : errStr = "Some data was the wrong type." case -1704 : errStr = "Some parameter was invalid." case -1705 : errStr = "Operation involving a list item failed." case -1706 : errStr = "Need a newer version of the Apple Event Manager." case -1707 : errStr = "Event isn't an Apple event." case -1708 : errStr = "<reference> doesn't understand the <commandName> message." case -1709 : errStr = "AEResetTimer was passed an invalid reply." case -1710 : errStr = "Invalid sending mode was passed." case -1711 : errStr = "User canceled out of wait loop for reply or receipt." case -1712 : errStr = "Apple event timed out." case -1713 : errStr = "No user interaction allowed." case -1714 : errStr = "Wrong keyword for a special function." case -1715 : errStr = "Some parameter wasn't understood." case -1716 : errStr = "Unknown Apple event address type." case -1717 : errStr = "The handler <identifier> is not defined." case -1718 : errStr = "Reply has not yet arrived." case -1719 : errStr = "Can't get <reference>. Invalid index." case -1720 : errStr = "Invalid range." case -1721 : errStr = "<expression> doesn't match the parameters <parameterNames> for <commandName>." case -1723 : errStr = "Can't get <expression>. Access not allowed." case -1725 : errStr = "Illegal logical operator called." case -1726 : errStr = "Illegal comparison or logical." case -1727 : errStr = "Expected a reference." case -1728 : errStr = "Can't get <reference>." case -1729 : errStr = "Object counting procedure returned a negative count." case -1730 : errStr = "Container specified was an empty list." case -1731 : errStr = "Unknown object type." case -1750 : errStr = "Scripting component error." case -1751 : errStr = "Invalid script id." case -1752 : errStr = "Script doesn't seem to belong to AppleScript." case -1753 : errStr = "Script error." case -1754 : errStr = "Invalid selector given." case -1755 : errStr = "Invalid access." case -1756 : errStr = "Source not available." case -1757 : errStr = "No such dialect." case -1758 : errStr = "Data couldn't be read because its format is obsolete." case -1759 : errStr = "Data couldn't be read because its format is too new." case -1760 : errStr = "Recording is already on.' end select print errStr end if include "Subs Quick Event Loop.Incl" '------------ End Code --------------- 5.) You may want to explore FB^3"s EJECT function which would do what you want, but you would have to wrestle with finding the ID number of the volume you wish to unmount. Ken p.s. Watch for e-mail line breaks and lost constant underscores on the Associate server.