{"id":966,"date":"2011-06-06T13:34:52","date_gmt":"2011-06-06T18:34:52","guid":{"rendered":"http:\/\/www.jaimerios.com\/?p=966"},"modified":"2011-06-06T13:34:52","modified_gmt":"2011-06-06T18:34:52","slug":"xcode-script-menu-and-p4","status":"publish","type":"post","link":"https:\/\/jaimerios.com\/?p=966","title":{"rendered":"Xcode Script Menu and P4"},"content":{"rendered":"<p>Here is another way that I am able to check out a file using the Xcode Script Menu and a keyboard hot key:<\/p>\n<pre lang=\"BASH\">\n#!\/bin\/sh\n# This shell script checks out the current file from Perforce\n\n# Get the file's path components\nFULL_FILE_PATH=\"%%%{PBXFilePath}%%%\"\nSRC_FILE=${FULL_FILE_PATH##*\/}\nFILE_PATH=${FULL_FILE_PATH%\/*}\n\n# This line brings in my settings so that Perforce knows what server I am connecting to\n# This also assumes that the root of my project has a perforce.rc file\nsource ~\/.bash_login\n\nif [ -f $FULL_FILE_PATH ]\nthen\n\tcd $FILE_PATH\n\t\/usr\/local\/bin\/p4 edit $FILENAME\nfi\n<\/pre>\n<p>The &#8220;Output:&#8221; and &#8220;Errors:&#8221; options were set to  &#8220;Display in Alert&#8221;, not that this is actually applicable here, but that&#8217;s how I have it set up.<\/p>\n<p>And here is what my .bash_login file looks like:<\/p>\n<pre lang=\"BASH\">\n# Perforce settings                                                                                                                         \nexport P4CONFIG=perforce.rc\nexport P4PORT=mysuperawesomedomain.com:1666\nexport P4USER=jaimerios\nexport P4EDITOR=emacs\nexport P4PASSWD=haaaahahahaHahaHAA!\n<\/pre>\n<p>Oh, and if you want a good starter for how to work with the Script Menu scripts in Xcode, check out this site: <a href=\"http:\/\/www.mactech.com\/articles\/mactech\/Vol.23\/23.01\/2301XCode\/index.html\" target=\"_blank\" rel=\"noopener\">http:\/\/www.mactech.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is another way that I am able to check out a file using the Xcode Script Menu and a keyboard hot key: #!\/bin\/sh # This shell script checks out the current file from Perforce # Get the file&#8217;s path components FULL_FILE_PATH=&#8221;%%%{PBXFilePath}%%%&#8221; SRC_FILE=${FULL_FILE_PATH##*\/} FILE_PATH=${FULL_FILE_PATH%\/*} # This line brings in my settings so that Perforce knows &#8230; <a title=\"Xcode Script Menu and P4\" class=\"read-more\" href=\"https:\/\/jaimerios.com\/?p=966\" aria-label=\"Read more about Xcode Script Menu and P4\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[340,395,396,506],"class_list":["post-966","post","type-post","status-publish","format-standard","hentry","category-coding","tag-p4","tag-scm","tag-script","tag-xcode"],"_links":{"self":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts\/966","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=966"}],"version-history":[{"count":0,"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts\/966\/revisions"}],"wp:attachment":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=966"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}