Python request... copy path but remove some part

I use the Clip Path to Clipboard script from Michael Vaglienty. Works great.

But when I’m sending that path to another artist (via slack) I only need the path relative to the job we’re working on. So I’m trying to figure out the best way to copy the path, but only whatever is after something like: /Volumes/JobName/

Any thoughts?

Hey Bryan,

What about something like this?

job_name = "/Volumes/" + flame.project.current_project.nickname + "/"

for item in selection:
    file_path = item.path
#Remove /Volumes/JobName
slack_path = file_path.replace('job_name,'')

qt_app_instance = QtWidgets.QApplication.instance()
qt_app_instance.clipboard().setText(slack_path)

Edit:
You could also try splitting it after the 2nd or 3rd “/”

Ah Nice - I was trying to remove part but it looks like you are replacing it (with nothing).

I’ll try this.

Edit - Also need to have the flame project name match the ‘job folder’ name which I try to do.