On Dec 09, 2016, at 14:36, jgill <[email protected] 
<mailto:[email protected]>> wrote:
> I have set up a loop to find the difference between these two paths and it 
> produces "../Archive Photos/Juvenile-Shag.jpg" after a bit of massaging. That 
> is what I want. I just wondered if there is a more elegant way for doing it?


Hey Joe,

Experiment with this, and see if you can get it to work:

-------------------------------------------------------------------------------------------
set pathToRelativize to "/Users/jgill/Documents/Web/CHOG/CHOG1and1/Archive 
Photos/Juvenile-Shag.jpg"
set referencePath to "/Users/jgill/Documents/Web/CHOG/CHOG1and1/Commoner 
Species Photos/Shag.htm"

set shCMD to "python -c 'import os.path, sys; print os.path.relpath(\"" & 
pathToRelativize & "\", \"" & referencePath & "\")'"
set stdOUT to do shell script shCMD
-------------------------------------------------------------------------------------------

--> "../../Archive Photos/Juvenile-Shag.jpg"

--
Take Care,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to