global theName, mynull set error_num to -128 set bkslsh to "\\" set mynull to "%20" set myvol to "open /Volumes" set y to 0 set k to 0 set L to {} tell application "Microsoft Entourage" activate tell application "System Events" key down command delay 1 keystroke "c" delay 1 key up command end tell end tell set x to the clipboard set text item delimiters to bkslsh set howmany to (count text items of x) -- set mypath to text item of x if howmany is less than 3 or (howmany - 3) is equal to 0 then my myerror(error_num) end if try repeat howmany times set k to k + 1 set myitem to text item k of x if myitem is equal to "amber" then set myitem to "Amber" end if set end of L to myitem end repeat end try try repeat (howmany - 3) times set y to y + 1 if text item (y + 3) of L contains mynull then set passthebuck to text item (y + 3) of L my myspace(passthebuck) set myvol to myvol & "/" & theName else set myvol to myvol & "/" & text item (y + 3) of L end if end repeat do shell script myvol on error number error_number my myerror(error_num) (* if error_number is -128 then error number -128 display dialog  "you are not able to open the exchange server link for one or more of the following reasons:" & return & return  & "you may not be connected to the network" & return & return  & " or the network may be down" & return & return &  "or the file location may have moved or doesn't exist" & return & return  & "or you may not have properly selected the exchange server link" & return & return  & "PLEASE CHECK THESE REASONS AND TRY AGAIN" *) end try on myspace(thebuck) set z to 0 set text item delimiters to mynull set thismany to (count text items of thebuck) set breakumup to text items of thebuck set theName to text item (z + 1) of thebuck repeat with abreak in breakumup set z to z + 1 if z is less than or equal to (thismany - 1) then set theName to theName & "\\ " & text item (z + 1) of thebuck end if end repeat return theName end myspace on myerror(error_number) if error_number is -128 then set thingsgonewrong to "you are not able to open the exchange server link for one or more of the following reasons:" & return & return  & "you may not be connected to the network" & return & return  & " or the network may be down" & return & return &  "or the file location may have moved or doesn't exist" & return & return  & "or you may not have properly selected the exchange server link" & return & return  & "PLEASE CHECK THESE REASONS AND TRY AGAIN" display dialog thingsgonewrong buttons {"Cancel"} end if end myerror