/core/externals/update-engine/externals/google-toolbox-for-mac/XcodePlugin/Resources/opencoverage.applescript

http://macfuse.googlecode.com/ · AppleScript · 45 lines · 14 code · 4 blank · 27 comment · 1 complexity · 72b1da3f244e7f9b5ac7d6279148ee71 MD5 · raw file

  1. (*
  2. opencoverage.applescript
  3. Copyright 2007-2009 Google Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. use this file except in compliance with the License. You may obtain a copy
  6. of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  10. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  11. License for the specific language governing permissions and limitations under
  12. the License.
  13. Support script for using gcov with Xcode
  14. *)
  15. (*
  16. gets passed a list of args from Xcode
  17. first arg is the path to open
  18. *)
  19. on run args
  20. -- check args
  21. set filename to POSIX path of item 1 of args
  22. -- check if it exists first
  23. set doesExist to false
  24. tell application "System Events"
  25. set doesExist to item filename exists
  26. end tell
  27. if doesExist then
  28. -- open it in coverstory
  29. do shell script "/usr/bin/open -a CoverStory " & quoted form of filename
  30. else
  31. -- report the error
  32. tell application "Xcode"
  33. display alert "The path we needed didn't exist." & return & quoted form of (filename)
  34. end tell
  35. end if
  36. end run