I have a python script:
import sublime, sublime_plugin
desired_path = "/some/path/i/want/to/go/"
# read speaking_to_sublime.py
# parse through it and store as a string
# store contents of speaking_to_sublime.py in here
speaking_to_sublime_string = ""
# use regular expressions to somehow replace:
# "/Users/max/test/test2/" with desired_path
# write speak_to_sublime_string to speaking_to_sublime.py
I was trying to modify the python script because I wasn't sure how to pass arguments to sublime from the command line. As a workaround I was going to make a custom plugin and change the "arguments" by writing them to a file right before I called the command using sublime from the command. It sounds roundabout but I didn't know about escaping the quotes when you pass arguments from the sublime cli yet. I actually haven't testing if it would work yet, but for anyone who is interested the appropriate regex can can found on rubular:
re = /"initial_path": "(.+)"/
the reason why I was trying to use regexs was because the path would be changing all the time since I was essentially planning to re-write the plugin every time it was called. I learned how to do it after watching a wonderful talk by Nell Shamrell