Jump to content


P4V and AppleScript

P4V OSX AppleScript

  • Please log in to reply
2 replies to this topic

#1 JeffB

JeffB

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 05 September 2018 - 05:52 PM

Does P4V on OSX support AppleScript?  I haven't found any documentation on AppleScript support, and when I attempt to load P4V's dictionary in Script Debugger, P4V.app is grayed out and isn't selectable.

What I'd like to do is this:  At the top of P4V is a search bar.  When a file's path is pasted in the search field, the explorer pane navigates to the file.  Our source tree is very large and nested, and I'd like to create an AppleScript where I pass in the path to the file, and then P4V navigates to the file in the tree.  Perhaps something like:

tell application p4v
activate
open "/users/me/src/somefile.txt"
end tell


or:

tell application p4v
activate
navigate to "/users/me/src/somefile.txt"
end tell


Thanks,

Jeff

#2 P4Jen

P4Jen

    Advanced Member

  • Staff Moderators
  • 137 posts

Posted 07 September 2018 - 04:58 PM

Hi Jeff,

It doesn't look like P4V supports being used in this way, where an external process (I.E AppleScript) can communicate with it and
invoke certain features.

However, you may be able to achieve what you want using P4VC, to activate certain features from the command-line.

More info is located here:
  https://www.perforce...tions.p4vc.html

Hope this helps,
Jen.


#3 JeffB

JeffB

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 13 September 2018 - 08:48 PM

Thanks Jen, I now have p4vc.  I'm not sure it does what I want to do though.  What I'd like to do, is given the file path to a file that's in source control, I'd like P4V to open and then navigate to the file in its Workspace tree.  Is this possible?p4vc has a workspace command, but when I run it, a dialog box with info about the workspace appears.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users