Re: PhotoScripter and Curves
Re: PhotoScripter and Curves
- Subject: Re: PhotoScripter and Curves
- From: Shane Stanley <email@hidden>
- Date: Thu, 28 Jun 2001 21:17:44 +1000
On 28/6/01 5:29 PM +1000, Simon Topliss, email@hidden, wrote:
>
That's the route I'm having to take. I actually need variations creating for
>
2 different value tolerances (3% and 5%), so I had to manually create all
>
52 curve settings files.
Such tedium...
>
>
I don't quite follow how you wrote out a new settings file each time. I
>
opened a curve setting with bbedit to see if I could use AS to create them,
>
but the code inside is all extended system characters. How did you read the
>
files?
With AppleScript ;-) The key is the ASCII numbers of the characters. The
sequence is as follows, where each number represents the equivalent ASCII
character, n is the number of points plotted, and the i and o values
represent the plot pairs:
0, 1, 0, 1, 0, n, 0, i1, 0, o1, 0, i2, 0, o1, 0, i3, 0, o3 [...]
So here's a typical snippet for three points at {14, 0}, {191,128} and {250,
255}, a fairly vicious curve:
set the0 to ASCII character 0
set the1 to ASCII character 1
set the3 to ASCII character 3
set the14 to ASCII character 14
set the191 to ASCII character 191
set the128 to ASCII character 128
set the250 to ASCII character 250
set the255 to ASCII character 255
set thePath to ":" as alias as text
set curvesFile to thePath & "Correction curve"
set curveData to the0 & the1 & the0 & the1 & the0 & the3 & the0 & the14 &
the0 & the0 & the0 & the191 & the0 & the128 & the0 & the250 & the0 & the255
set fileRef to (open for access file curvesFile with write permission)
set eof fileRef to 0
write curveData to fileRef
close access fileRef
tell application "Finder"
set creator type of file curvesFile to "8BIM"
set file type of file curvesFile to "8BSC"
end tell
--
Shane Stanley, email@hidden