--set PointFunctionWrapper to "NSMakePoint" set PointFunctionWrapper to "MakeRelativePoint" -- The name of your point-maker function. Is usually NSMakePoint. -- from http://www.apple.com/applescript/guidebook/sbrt/pgs/sbrt.07.htm on replace_chars(this_text, search_string, replacement_string) set AppleScript's text item delimiters to the search_string set the item_list to every text item of this_text set AppleScript's text item delimiters to the replacement_string set this_text to the item_list as string set AppleScript's text item delimiters to "" return this_text end replace_chars -- coerce to string, replacing decimal commas with decimal points under some locales on pointify(x) return replace_chars((x as string), ",", ".") end pointify on pointtostring(x) set p to item 1 of x set res to pointify(item 1 of p) & ", " & pointify(item 2 of p) return (PointFunctionWrapper of me) & "(" & res & ")" end pointtostring tell application "Adobe Photoshop CS3" set i to 1 set d to current document repeat with pathitem in (every path item of d) -- Seriously, AppleScript, wtf. set okaytoproceed to true try item 1 of entire path of pathitem on error set okaytoproceed to false end try if okaytoproceed then set str to "" set nl to " " set isfirst to true set str to str & (nl & "NSBezierPath *bp" & i & " = [[NSBezierPath alloc] init];") repeat with y in (every sub path item of pathitem) repeat with x in (every path point of y) set a to anchor of x if (a is not equal to left direction of x) then set le to left direction of x set ri to right direction of x if isfirst is true then set str to str & (nl & "[bp" & (i as string) & " moveToPoint:" & (pointtostring(a) of me) & "];") set isfirst to false end if set str to str & (nl & "[bp" & (i as string) & " curveToPoint:" & (pointtostring(a) of me) & " controlPoint1:" & (pointtostring(le) of me) & " controlPoint2:" & (pointtostring(ri) of me) & "];") else if isfirst is true then set str to str & (nl & "[bp" & (i as string) & " moveToPoint:" & (pointtostring(a) of me) & "];") set isfirst to false else set str to str & (nl & "[bp" & (i as string) & " lineToPoint:" & (pointtostring(a) of me) & "];") end if end if end repeat end repeat set i to i + 1 end if end repeat str end tell