In a previous post, Perforce and Xcode4, I created applescripts to work with Xcode4 and Perforce.

I updated the AppleScripts to work with Xcode5 only and added a couple of new scripts.

One, called p4_file_renamed.scpt, is used to update the renamed file Perforce when you are using Xcodes rename functionality, either directly or through the refactor functionality.

The other two scripts get the filename of the currently selected file or the full path of the file which is useful for when you want to find a file by path in P4V.

You can download the file here: xcode5_p4_applescripts


  1. Using these scripts i am unable to checkout files (i have installed P4 CLI ,also the scripts have been given full rights),still when i try to Unlock using XCode 5.1.1 ,I get this error “Failed to launch script /Users/IAmMac/Documents/p4_checkout.scpt: The operation couldn’t be completed. Exec format error”. I have copied the scripts to my “Document” folder and even the .bash_login is placed in the usr/bin and also in the document folder. (.bash_login) contains the P4USER ,P4CLIENTNAME and P4PORT.Please let know where i am going wrong

  2. The location of the scripts sound like they are in the wrong place.

    The scripts would go: ~/Library/Scripts/Applications/Xcode/

    To get to the folder easily, select the AppleScript menu when Xcode is active and select “Open Scripts Folder->Open Xcode Scripts Folder”

    The .bash_login file should be sitting in your home directory, and the AppleScripts are expecting them to be there.

    As for the p4 command line app, if you are gonna put them in /usr/bin, then modify the AppleScripts to point to /usr/bin instead of /usr/local/bin

Leave a Reply

Your email address will not be published. Required fields are marked *