Skip to content

Instantly share code, notes, and snippets.

@azimin
Last active December 23, 2016 23:02
Show Gist options
  • Save azimin/a8bdbbb470b616a5f52c35865c4753e5 to your computer and use it in GitHub Desktop.
Save azimin/a8bdbbb470b616a5f52c35865c4753e5 to your computer and use it in GitHub Desktop.
Search file for "Header Search Paths"
property fileToSearch : "UCSongTrainerRenderingController.h"
property finalPath : ""
set finalPath to do shell script ("mdfind -name " & fileToSearch & " -onlyin /")
set finalPath to replace_chars(finalPath, "/Users/azimin/iOSDeveloper/Uberchord-iOS", "$(PROJECT_DIR)")
set finalPath to replace_chars(finalPath, "/" & fileToSearch, "")
set finalPath to replace_chars(finalPath, " ", "\\ ")
set the clipboard to finalPath
on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text
end replace_chars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment