This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > PainShop Pro Scripting > June 2007 > PING Suz & other scripters - v.9 & v.8 text compatibility





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author PING Suz & other scripters - v.9 & v.8 text compatibility
JoeB

2007-06-15, 6:43 pm

The Scripting with PSP 8 versus scripting with PSP9 thread has brought up,
among other things, the issue of recording a script in v.9 that includes a
text component and making it run in v.8. The issue is the TextEx command
as far as I can tell.

I checked out Suz's tip #118 in PSPX Tips & Tricks. I recorded a simple
script in v.9 which creates text, and tried inserting the GetVersionInfo
prior to the #Text lines that were created (I'm experimenting, never having
used it before), but running it in v.8 gives me an error when it hits the
else: line - invalid syntax.

Even if I got it to work past there, would this work anyway? I'm wondering
how it would handle the extra stuff in the v.9 script, like Textflow, and
for Antialias which in v.9 comes out AntialiasEx.

Any help would be greatly appreciated.

Regards,

JoeB
SuzShook

2007-06-15, 10:22 pm

JoeB wrote:
> The Scripting with PSP 8 versus scripting with PSP9 thread has
> brought up, among other things, the issue of recording a script in
> v.9 that includes a text component and making it run in v.8. The
> issue is the TextEx command as far as I can tell.
>
> I checked out Suz's tip #118 in PSPX Tips & Tricks. I recorded a
> simple script in v.9 which creates text, and tried inserting the
> GetVersionInfo prior to the #Text lines that were created (I'm
> experimenting, never having used it before), but running it in v.8
> gives me an error when it hits the else: line - invalid syntax.
>
> Even if I got it to work past there, would this work anyway? I'm
> wondering how it would handle the extra stuff in the v.9 script, like
> Textflow, and for Antialias which in v.9 comes out AntialiasEx.
>
> Any help would be greatly appreciated.
>
> Regards,
>
> JoeB


You have to set up your script something like this, JoeB:

# GetVersionInfo
Version = App.Do(Environment, 'GetVersionInfo',)

if Version['MajorVersion'] == 8:
# Text
App.Do( Environment, 'Text', {..........etc.
else:
# TextEx
App.Do( Environment, 'TextEx', {...........etc.

This way, if version 8 is running, the Text command will execute, and if
it's not version 8, the TextEx command will run. If a version 9 script
(which would contain the TextEx command) is executed in version 8,
parameters unknown to 8 will just be ignored. If a parameter is needed, for
example, for anti-aliasing, either the last used values will be used, or the
default values, whichever way the program has been coded, and that's a crap
shoot - it's different for different parameters and I can't begin to see any
logic in what PSP does! By the way, the anti-alias parameter in a PSP 8
text command is one of these:
'Antialias': App.Constants.Boolean.true,
'Antialias': App.Constants.Boolean.false,
and in a PSP 9 TextEx command, is one of the following:
'AntialiasStyle': App.Constants.AntialiasEx.Sharp,
'AntialiasStyle': App.Constants.AntialiasEx.Smooth,
'AntialiasStyle': App.Constants.AntialiasEx.None,

So if a PSP 9 script is run in PSP 8, it will ignore the AntialiasStyle
parameter, because it doesn't recognize it. You could put your address into
a script, as long as it looks like a parameter, and the script will run
without a problem! It ignores what it can't figure out - just as long as
it's in quotes, followed by a comma, it will probably work! I just inserted
this parameter, and my script ran like a charm:
'BroadStreet': True,

Hope this answers your questions, JoeB. Suz



JoeB

2007-06-16, 3:17 am

"SuzShook" <suzshook@roadrunner.com> wrote in news:4671c8b1$1_3@cnews:

> JoeB wrote:
>
> You have to set up your script something like this, JoeB:
>
> # GetVersionInfo
> Version = App.Do(Environment, 'GetVersionInfo',)
>
> if Version['MajorVersion'] == 8:
> # Text
> App.Do( Environment, 'Text', {..........etc.
> else:
> # TextEx
> App.Do( Environment, 'TextEx', {...........etc.
>
> This way, if version 8 is running, the Text command will execute, and
> if it's not version 8, the TextEx command will run. If a version 9
> script (which would contain the TextEx command) is executed in version
> 8, parameters unknown to 8 will just be ignored. If a parameter is
> needed, for example, for anti-aliasing, either the last used values
> will be used, or the default values, whichever way the program has
> been coded, and that's a crap shoot - it's different for different
> parameters and I can't begin to see any logic in what PSP does! By
> the way, the anti-alias parameter in a PSP 8 text command is one of
> these:
> 'Antialias': App.Constants.Boolean.true,
> 'Antialias': App.Constants.Boolean.false,
> and in a PSP 9 TextEx command, is one of the following:
> 'AntialiasStyle': App.Constants.AntialiasEx.Sharp,
> 'AntialiasStyle': App.Constants.AntialiasEx.Smooth,
> 'AntialiasStyle': App.Constants.AntialiasEx.None,
>
> So if a PSP 9 script is run in PSP 8, it will ignore the
> AntialiasStyle parameter, because it doesn't recognize it. You could
> put your address into a script, as long as it looks like a parameter,
> and the script will run without a problem! It ignores what it can't
> figure out - just as long as it's in quotes, followed by a comma, it
> will probably work! I just inserted this parameter, and my script ran
> like a charm:
> 'BroadStreet': True,
>
> Hope this answers your questions, JoeB. Suz
>


Thanks Suz. I'll give this a try over the weekend and let you know how
things work out. It sound's like true backward compatibility when it
comes to text from v.9 to v.8 might not be achievable, but this is
likely close enough for government work :-). I believe, from previous
info from you, that adding the True/False Boolean code at the top of the
script handles the True/False errors that one gets in v.8 with other
commands recorded in v.9 scripts.

Thanks again (also for the #118 Tip, because it helped more than the
Scripting for Authors stuff), and I'll keep you advised as to how it
goes.

Regards,

JoeB
JoeB

2007-06-16, 6:21 pm

"SuzShook" <suzshook@roadrunner.com> wrote in news:4671c8b1$1_3@cnews:

> JoeB wrote:
>
> You have to set up your script something like this, JoeB:
>
> # GetVersionInfo
> Version = App.Do(Environment, 'GetVersionInfo',)
>
> if Version['MajorVersion'] == 8:
> # Text
> App.Do( Environment, 'Text', {..........etc.
> else:
> # TextEx
> App.Do( Environment, 'TextEx', {...........etc.
>
> This way, if version 8 is running, the Text command will execute, and
> if it's not version 8, the TextEx command will run. If a version 9
> script (which would contain the TextEx command) is executed in version
> 8, parameters unknown to 8 will just be ignored. If a parameter is
> needed, for example, for anti-aliasing, either the last used values
> will be used, or the default values, whichever way the program has
> been coded, and that's a crap shoot - it's different for different
> parameters and I can't begin to see any logic in what PSP does! By
> the way, the anti-alias parameter in a PSP 8 text command is one of
> these:
> 'Antialias': App.Constants.Boolean.true,
> 'Antialias': App.Constants.Boolean.false,
> and in a PSP 9 TextEx command, is one of the following:
> 'AntialiasStyle': App.Constants.AntialiasEx.Sharp,
> 'AntialiasStyle': App.Constants.AntialiasEx.Smooth,
> 'AntialiasStyle': App.Constants.AntialiasEx.None,
>
> So if a PSP 9 script is run in PSP 8, it will ignore the
> AntialiasStyle parameter, because it doesn't recognize it. You could
> put your address into a script, as long as it looks like a parameter,
> and the script will run without a problem! It ignores what it can't
> figure out - just as long as it's in quotes, followed by a comma, it
> will probably work! I just inserted this parameter, and my script ran
> like a charm:
> 'BroadStreet': True,
>
> Hope this answers your questions, JoeB. Suz
>


Hi Suz,

I'm afraid I'm confused (not unusual). I don't know what is meant by
the elipses and etc. in your code, so had to remove it bacause of the
invalid syntax I got the first time the script got to the first line
containing them. And once again, the script stops at the else: line
when using v.8.1.

I have attached the script, and perhaps you can tell me where I'm going
wrong. Remember, this is my first attempt at using GetVersionInfo so
I'm experimenting as I go and trying to fix stuff as errors pop up in
the SOP.

Regards,

JoeB

begin 644 Text Test 2.PspScript
M9G)O;2!*87-C07!P(&EM<&]R="`J#0II;7!O<G0@4%-0571I;',-"@T*9&5F
M(%-C<FEP=%!R;W!E<G1I97,H*3H-"B`@("!R971U<FX@>PT*("`@("`@("`G
M075T:&]R)SH@=2<G+`T*("`@("`@("`G0V]P>7)I9VAT)SH@=2<G+`T*("`@
M("`@("`G1&5S8W)I<'1I;VXG.B!U)R<L#0H@("`@("`@("=(;W-T)SH@=2<G
M+`T*("`@("`@("`G2&]S="!697)S:6]N)SH@=2<G#0H@("`@("`@('T-"@T*
M5')U92`]($%P<"Y#;VYS=&%N=',N0F]O;&5A;BYT<G5E#0I&86QS92`]($%P
M<"Y#;VYS=&%N=',N0F]O;&5A;BYF86QS90T*#0H-"F1E9B!$;RA%;G9I<F]N
M;65N="DZ#0H@("`@(R!%;F%B;&5/<'1I;6EZ96138W)I<'15;F1O#0H@("`@
M07!P+D1O*"!%;G9I<F]N;65N="P@)T5N86)L94]P=&EM:7IE9%-C<FEP=%5N
M9&\G+"![#0H@("`@("`@("`@("`G1V5N97)A;%-E='1I;F=S)SH@>PT*("`@
M("`@("`@("`@("`@("=%>&5C=71I;VY-;V1E)SH@07!P+D-O;G-T86YT<RY%
M>&5C=71I;VY-;V1E+D1E9F%U;'0L(`T*("`@("`@("`@("`@("`@("=!=71O
M06-T:6]N36]D92<Z($%P<"Y#;VYS=&%N=',N075T;T%C=&EO;DUO9&4N36%T
M8V@L(`T*("`@("`@("`@("`@("`@("=697)S:6]N)SH@*"@Y+#`L,2DL,2D-
M"B`@("`@("`@("`@("`@("!]#0H@("`@("`@("`@("!]*0T*#0H-"B`@("`C
M($=E=%9E<G-I;VY);F9O#0H@("`@5F5R<VEO;B`]($%P<"Y$;RA%;G9I<F]N
M;65N="P@)T=E=%9E<G-I;VY);F9O)RPI#0H-"B`@("!I9B!697)S:6]N6R=-
M86IO<E9E<G-I;VXG72`]/2`X.@T*("`@("`@("`@("`@(R!497AT#0H@("`@
M("`@("`@("!!<'`N1&\H($5N=FER;VYM96YT+"`G5&5X="<L('L-"B`@("!E
M;'-E.@T*("`@("`@("`@("`C(%1E>'1%>`T*("`@("`@("`@("`@07!P+D1O
M*"!%;G9I<F]N;65N="P@)U1E>'1%>"<L('L-"@T*#0H-"B`@("`C(%1E>'0-
M"B`@("!!<'`N1&\H($5N=FER;VYM96YT+"`G5&5X=$5X)RP@>PT*("`@("`@
M("`@("`@)U9I<VEB:6QI='DG.B!4<G5E+"`-"B`@("`@("`@("`@("=#<F5A
M=&5!<R<Z($%P<"Y#;VYS=&%N=',N0W)E871E07,N5F5C=&]R+"`-"B`@("`@
M("`@("`@("=3=&%R="<Z("@S-3@L,3DY*2P@#0H@("`@("`@("`@("`G5&5X
M=$9L;W<G.B!!<'`N0V]N<W1A;G1S+E1E>'1&;&]W+DAO<FEZ;VYT86Q$;W=N
M+"`-"B`@("`@("`@("`@("=497AT5'EP92<Z($%P<"Y#;VYS=&%N=',N5&5X
M=%1Y<&4N5&5X=$)A<V4L(`T*("`@("`@("`@("`@)TUA=')I>"<Z(%L-"B`@
M("`@("`@("`@("`@("`Q+`T*("`@("`@("`@("`@("`@(#`L#0H@("`@("`@
M("`@("`@("`@,"P-"B`@("`@("`@("`@("`@("`P+`T*("`@("`@("`@("`@
M("`@(#$L#0H@("`@("`@("`@("`@("`@,"P-"B`@("`@("`@("`@("`@("`P
M+`T*("`@("`@("`@("`@("`@(#`L#0H@("`@("`@("`@("`@("`@,0T*("`@
M("`@("`@("`@72P@#0H@("`@("`@("`@("`G075T;TME<FXG.B!4<G5E+"`-
M"B`@("`@("`@("`@("=+97)N:6YG)SH@-S4L(`T*("`@("`@("`@("`@)U1R
M86-K:6YG)SH@,"P@#0H@("`@("`@("`@("`G3&5A9&EN9R<Z(#`L(`T*("`@
M("`@("`@("`@)T9O;G0G.B!U)T%R:6%L)RP@#0H@("`@("`@("`@("`G4&]I
M;G13:7IE)SH@,3@L(`T*("`@("`@("`@("`@)TET86QI8R<Z($9A;'-E+"`-
M"B`@("`@("`@("`@("=";VQD)SH@1F%L<V4L(`T*("`@("`@("`@("`@)U5N
M9&5R;&EN92<Z($9A;'-E+"`-"B`@("`@("`@("`@("=3=')I:V5T:')U)SH@
M1F%L<V4L(`T*("`@("`@("`@("`@)T%N=&EA;&EA<U-T>6QE)SH@07!P+D-O
M;G-T86YT<RY!;G1I86QI87-%>"Y3:&%R<"P@#0H@("`@("`@("`@("`G5V%R
M<%1E>'0G.B!4<G5E+"`-"B`@("`@("`@("`@("=3971497AT)SH@07!P+D-O
M;G-T86YT<RY*=7-T:69Y+D-E;G1E<BP@#0H@("`@("`@("`@("`G1FEL;"<Z
M('L-"B`@("`@("`@("`@("`@("`G0V]L;W(G.B`H,C4U+#`L,"DL(`T*("`@
M("`@("`@("`@("`@("=0871T97)N)SH@3F]N92P@#0H@("`@("`@("`@("`@
M("`@)T=R861I96YT)SH@3F]N92P@#0H@("`@("`@("`@("`@("`@)U1E>'1U
M<F4G.B!.;VYE+"`-"B`@("`@("`@("`@("`@("`G07)T)SH@3F]N92P@#0H@
M("`@("`@("`@("`@("`@)TED96YT:71Y)SH@=2=-871E<FEA;"<-"B`@("`@
M("`@("`@("`@("!]+"`-"B`@("`@("`@("`@("=3=')O:V4G.B![#0H@("`@
M("`@("`@("`@("`@)T-O;&]R)SH@*#`L,"PP*2P@#0H@("`@("`@("`@("`@
M("`@)U!A='1E<FXG.B!.;VYE+"`-"B`@("`@("`@("`@("`@("`G1W)A9&EE
M;G0G.B!.;VYE+"`-"B`@("`@("`@("`@("`@("`G5&5X='5R92<Z($YO;F4L
M(`T*("`@("`@("`@("`@("`@("=!<G0G.B!.;VYE+"`-"B`@("`@("`@("`@
M("`@("`G261E;G1I='DG.B!U)TUA=&5R:6%L)PT*("`@("`@("`@("`@("`@
M('TL(`T*("`@("`@("`@("`@)TQI;F57:61T:"<Z(#`L(`T*("`@("`@("`@
M("`@)TQI;F53='EL92<Z('L-"B`@("`@("`@("`@("`@("`G3F%M92<Z('4G
M)RP@#0H@("`@("`@("`@("`@("`@)T9I<G-T0V%P)SH@*'4G)RPP+C(U+#`N
M,C4I+"`-"B`@("`@("`@("`@("`@("`G3&%S=$-A<"<Z("AU)R<L,"XR-2PP
M+C(U*2P@#0H@("`@("`@("`@("`@("`@)T9I<G-T4V5G0V%P)SH@*'4G)RPP
M+C(U+#`N,C4I+"`-"B`@("`@("`@("`@("`@("`G3&%S=%-E9T-A<"<Z("AU
M)R<L,"XR-2PP+C(U*2P@#0H@("`@("`@("`@("`@("`@)U5S95-E9VUE;G1#
M87!S)SH@1F%L<V4L(`T*("`@("`@("`@("`@("`@("=396=M96YT<R<Z(%M=
M#0H@("`@("`@("`@("`@("`@?2P@#0H@("`@("`@("`@("`G2F]I;B<Z($%P
M<"Y#;VYS=&%N=',N2F]I;G13='EL92Y-:71E<BP@#0H@("`@("`@("`@("`G
M36ET97),:6UI="<Z(#(P+"`-"B`@("`@("`@("`@("=#:&%R86-T97)S)SH@
M=2=4:&ES(&ES(&$@=&5S="XG+"`-"B`@("`@("`@("`@("=3=')I;F=S)SH@
M3F]N92P@#0H@("`@("`@("`@("`G5&5X=%1A<F=E="<Z("@P+#`L6S%=+%1R
M=64I+"`-"B`@("`@("`@("`@("=0871H5&%R9V5T)SH@3F]N92P@#0H@("`@
M("`@("`@("`G1V5N97)A;%-E='1I;F=S)SH@>PT*("`@("`@("`@("`@("`@
M("=%>&5C=71I;VY-;V1E)SH@07!P+D-O;G-T86YT<RY%>&5C=71I;VY-;V1E
M+D1E9F%U;'0L(`T*("`@("`@("`@("`@("`@("=!=71O06-T:6]N36]D92<Z
M($%P<"Y#;VYS=&%N=',N075T;T%C=&EO;DUO9&4N36%T8V@L(`T*("`@("`@
M("`@("`@("`@("=697)S:6]N)SH@*"@Y+#`L,2DL,2D-"B`@("`@("`@("`@
:("`@("!]#0H@("`@("`@("`@("!]*0T*#0H!
`
end

Spandex Rutabaga

2007-06-16, 6:21 pm

JoeB wrote:
>
> "SuzShook" <suzshook@roadrunner.com> wrote in news:4671c8b1$1_3@cnews:


[color=darkred]
> I'm afraid I'm confused (not unusual). I don't know what is meant by
> the elipses and etc. in your code, so had to remove it bacause of the
> invalid syntax I got the first time the script got to the first line
> containing them.


The ellipsis implies the normal English convention of elision
of material. They need to be replaced by the rest of the text
command. In the case of TextEx in your attached script the
lines:
else:
# TextEx
App.Do( Environment, 'TextEx', {...........etc.

need to be replaced with the complete command (watch out for
line wrapping in the GeneralSettings):

else:
# TextEx
App.Do( Environment, 'TextEx', {
'Visibility': True,
'CreateAs': App.Constants.CreateAs.Vector,
'Start': (358,199),
'TextFlow': App.Constants.TextFlow.HorizontalDown,
'TextType': App.Constants.TextType.TextBase,
'Matrix': [
1,
0,
0,
0,
1,
0,
0,
0,
1
],
'AutoKern': True,
'Kerning': 75,
'Tracking': 0,
'Leading': 0,
'Font': u'Arial',
'PointSize': 18,
'Italic': False,
'Bold': False,
'Underline': False,
'Strikethru': False,
'AntialiasStyle': App.Constants.AntialiasEx.Sharp,
'WarpText': True,
'SetText': App.Constants.Justify.Center,
'Fill': {
'Color': (255,0,0),
'Pattern': None,
'Gradient': None,
'Texture': None,
'Art': None,
'Identity': u'Material'
},
'Stroke': {
'Color': (0,0,0),
'Pattern': None,
'Gradient': None,
'Texture': None,
'Art': None,
'Identity': u'Material'
},
'LineWidth': 0,
'LineStyle': {
'Name': u'',
'FirstCap': (u'',0.25,0.25),
'LastCap': (u'',0.25,0.25),
'FirstSegCap': (u'',0.25,0.25),
'LastSegCap': (u'',0.25,0.25),
'UseSegmentCaps': False,
'Segments': []
},
'Join': App.Constants.JointStyle.Miter,
'MiterLimit': 20,
'Characters': u'This is a test.',
'Strings': None,
'TextTarget': (0,0,[1],True),
'PathTarget': None,
'GeneralSettings': {
'ExecutionMode':
App.Constants.ExecutionMode.Default,
'AutoActionMode':
App.Constants.AutoActionMode.Match,
'Version': ((9,0,1),1)
}
})
Willy

2007-06-16, 6:21 pm

Another way might be to use the try/except command. Try the newer version
first then the exception would be v8, since the text command the newer
versions will work with the v8 syntax.
W

"JoeB" <mymail@myserver.com> wrote in message
news:Xns99507E95AE3CBJoeB@207.107.16.194...
> The Scripting with PSP 8 versus scripting with PSP9 thread has brought up,
> among other things, the issue of recording a script in v.9 that includes a
> text component and making it run in v.8. The issue is the TextEx command
> as far as I can tell.
>
> I checked out Suz's tip #118 in PSPX Tips & Tricks. I recorded a simple
> script in v.9 which creates text, and tried inserting the GetVersionInfo
> prior to the #Text lines that were created (I'm experimenting, never
> having
> used it before), but running it in v.8 gives me an error when it hits the
> else: line - invalid syntax.
>
> Even if I got it to work past there, would this work anyway? I'm
> wondering
> how it would handle the extra stuff in the v.9 script, like Textflow, and
> for Antialias which in v.9 comes out AntialiasEx.
>
> Any help would be greatly appreciated.
>
> Regards,
>
> JoeB



JoeB

2007-06-16, 10:17 pm

Spandex Rutabaga <SpRu@agabatur.xednaps> wrote in
news:467441B6.750032DD@agabatur.xednaps:

> JoeB wrote:
@cnews:[color=darkred]
>
>
>
> The ellipsis implies the normal English convention of elision
> of material. They need to be replaced by the rest of the text
> command. In the case of TextEx in your attached script the
> lines:
> else:
> # TextEx
> App.Do( Environment, 'TextEx', {...........etc.
>
> need to be replaced with the complete command (watch out for
> line wrapping in the GeneralSettings):
>



Well, I'm obviously in over my head because when I paste my textex info
under the else statement I still get an error at the else: line.

If somebody would be willing to just take the script I posted and add
the code to it so that it works in v.8, save it as a pspscript and post
back, then I'd be able to compare what works with what I keep trying
that doesn't work. I'm afraid I'm better with visual representations
than verbal (verbose as I may be at times :-) And no, I didn't have any
wrapped lines.

Regards,

JoeB





> else:
> # TextEx
> App.Do( Environment, 'TextEx', {
> 'Visibility': True,
> 'CreateAs': App.Constants.CreateAs.Vector,
> 'Start': (358,199),
> 'TextFlow': App.Constants.TextFlow.HorizontalDown,
> 'TextType': App.Constants.TextType.TextBase,
> 'Matrix': [
> 1,
> 0,
> 0,
> 0,
> 1,
> 0,
> 0,
> 0,
> 1
> ],
> 'AutoKern': True,
> 'Kerning': 75,
> 'Tracking': 0,
> 'Leading': 0,
> 'Font': u'Arial',
> 'PointSize': 18,
> 'Italic': False,
> 'Bold': False,
> 'Underline': False,
> 'Strikethru': False,
> 'AntialiasStyle': App.Constants.AntialiasEx.Sharp,
> 'WarpText': True,
> 'SetText': App.Constants.Justify.Center,
> 'Fill': {
> 'Color': (255,0,0),
> 'Pattern': None,
> 'Gradient': None,
> 'Texture': None,
> 'Art': None,
> 'Identity': u'Material'
> },
> 'Stroke': {
> 'Color': (0,0,0),
> 'Pattern': None,
> 'Gradient': None,
> 'Texture': None,
> 'Art': None,
> 'Identity': u'Material'
> },
> 'LineWidth': 0,
> 'LineStyle': {
> 'Name': u'',
> 'FirstCap': (u'',0.25,0.25),
> 'LastCap': (u'',0.25,0.25),
> 'FirstSegCap': (u'',0.25,0.25),
> 'LastSegCap': (u'',0.25,0.25),
> 'UseSegmentCaps': False,
> 'Segments': []
> },
> 'Join': App.Constants.JointStyle.Miter,
> 'MiterLimit': 20,
> 'Characters': u'This is a test.',
> 'Strings': None,
> 'TextTarget': (0,0,[1],True),
> 'PathTarget': None,
> 'GeneralSettings': {
> 'ExecutionMode':
> App.Constants.ExecutionMode.Default,
> 'AutoActionMode':
> App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })


SuzShook

2007-06-17, 6:18 pm

underprocessable
JoeB

2007-06-17, 6:18 pm

"SuzShook" <suzshook@roadrunner.com> wrote in news:4673c143$1_3@cnews:

> Here it is, Joe. Suz
>


Thanks Suz. I was operating under a mis-apprehension, I think. If I
understand correctly, the only way to do it is to record the text in both
v.8 and v.9, placing the code for both in the GetVersionInfo command. What
I mistakenly thought could be done was to use the command in some way that,
if you recorded the script in v.9, you could just tell v.8 to treat TextEx
as Text, and any other code that ended in ex as if it didn't end with ex.
Kind of like being able to define True like this

True = App.Constants.Boolean.true
False = App.Constants.Boolean.false

at the top of a script and not have to use App.Constants.Boolean throughout
the script.

Regards,

JoeB
SuzShook

2007-06-17, 6:18 pm

JoeB wrote:
> "SuzShook" <suzshook@roadrunner.com> wrote in news:4673c143$1_3@cnews:
>
>
> Thanks Suz. I was operating under a mis-apprehension, I think. If I
> understand correctly, the only way to do it is to record the text in
> both v.8 and v.9, placing the code for both in the GetVersionInfo
> command.


You do need to have the Text command recorded in both versions, but you
don't place the code for those commands in the GetVersionInfo command - what
you do is use the results returned from the GetVersionInfo command to decide
which text command to execute - Text or TextEx. This is not just
semantics - it's the reality of what we're doing here. Hope you understand
this, JoeB.

What I mistakenly thought could be done was to use the
> command in some way that, if you recorded the script in v.9, you
> could just tell v.8 to treat TextEx as Text, and any other code that
> ended in ex as if it didn't end with ex. Kind of like being able to
> define True like this
>
> True = App.Constants.Boolean.true
> False = App.Constants.Boolean.false
>
> at the top of a script and not have to use App.Constants.Boolean
> throughout the script.


If only it were that simple, JoeB!!!! Suz

>
> Regards,
>
> JoeB




JoeB

2007-06-21, 6:33 pm

"SuzShook" <suzshook@roadrunner.com> wrote in news:46744d51$1_3@cnews:

> JoeB wrote:
>
> You do need to have the Text command recorded in both versions, but
> you don't place the code for those commands in the GetVersionInfo
> command - what you do is use the results returned from the
> GetVersionInfo command to decide which text command to execute - Text
> or TextEx. This is not just semantics - it's the reality of what
> we're doing here. Hope you understand this, JoeB.
>


I'm not sure if I don't understand or if it's just my terminology that
is wrong. If the GetVersionInfo command is simply this:

# GetVersionInfo
Version = App.Do(Environment, 'GetVersionInfo',)

if Version['MajorVersion'] == 8:

then I guess what you're saying is that you have to record the text
script in v.8, and place it under the GetVersionInfo command - i.e.,
it's not placed "in" the command as I had stated.

If, however, the GetVersionInfo command is this:

# GetVersionInfo
Version = App.Do(Environment, 'GetVersionInfo',)

if Version['MajorVersion'] == 8:

else:

which is what I was thinking, then it seems like the recorded v.8 text
is placed within the command.

Of course, the semantic point seems to be moot in any event, because if
I understand correctly there is no way, by recording a script with a
text component in v.9, that you can just use a snippet of some sort with
perhaps minor editing to to make it work in v.8. You actually have to
either know how to script the v.8 text component or have a copy of v.8
and record the text again in that version to make the script compatible
with both versions.


> What I mistakenly thought could be done was to use the
>
> If only it were that simple, JoeB!!!! Suz
>


One can always have high hopes :-)

Regards,

JoeB
SuzShook

2007-06-21, 10:18 pm



JoeB wrote:
> "SuzShook" <suzshook@roadrunner.com> wrote in news:46744d51$1_3@cnews:
>
>
> I'm not sure if I don't understand or if it's just my terminology that
> is wrong. If the GetVersionInfo command is simply this:
>
> # GetVersionInfo
> Version = App.Do(Environment, 'GetVersionInfo',)


The GetVersionInfo command is JUST the above - the "if" statement that
follows is not part of the GetVersionInfo command (and BTW, that comma after
'GetVersionInfo' really shouldn't be there - I know, that line comes from
the script I posted for you, but the comma should not be there). Yes, you
would have to record the Text command in PSP 8 and place it after the "if
Version['MajorVersion'] == 8: line, indented 4 spaces. And then you would
have to record the TextEx command in PSP 9 or higher and place it after the
"else:" line, indented 4 spaces. The two text commands are part of the
if-else structure, which is entirely independent of the GetVersionInfo
command. Granted, the "if" part of that structure extracts information
returned by the GetVersionInfo command, but the if-else structure is not
part of that command. It's just a decision-making structure used in Python,
like other programming languages, enabling the script to take different
logic paths based on tested values.

You're right - you cannot use a Text step recorded in PSP 9 in a script
running in PSP 8 - that's because in PSP 9 and higher, a text-writing action
would be recorded as a TextEx command, and PSP 8 does not recognize that
command and running a script with it will cause PSP 8 to generate an error
message.

>
> if Version['MajorVersion'] == 8:
>
> then I guess what you're saying is that you have to record the text
> script in v.8, and place it under the GetVersionInfo command - i.e.,
> it's not placed "in" the command as I had stated.
>
> If, however, the GetVersionInfo command is this:
>
> # GetVersionInfo
> Version = App.Do(Environment, 'GetVersionInfo',)
>
> if Version['MajorVersion'] == 8:
>
> else:
>
> which is what I was thinking, then it seems like the recorded v.8 text
> is placed within the command.
>
> Of course, the semantic point seems to be moot in any event, because
> if I understand correctly there is no way, by recording a script with
> a text component in v.9, that you can just use a snippet of some sort
> with perhaps minor editing to to make it work in v.8. You actually
> have to either know how to script the v.8 text component or have a
> copy of v.8 and record the text again in that version to make the
> script compatible with both versions.


This is correct, JoeB.

Hope I've clarified things a bit for you. Suz

>
>
>
> One can always have high hopes :-)
>
> Regards,
>
> JoeB



JoeB

2007-06-21, 10:18 pm

"SuzShook" <suzshook@roadrunner.com> wrote in news:4679c545$1_3@cnews:

>
>
> JoeB wrote:
>
> The GetVersionInfo command is JUST the above - the "if" statement that
> follows is not part of the GetVersionInfo command (and BTW, that comma
> after 'GetVersionInfo' really shouldn't be there - I know, that line
> comes from the script I posted for you, but the comma should not be
> there). Yes, you would have to record the Text command in PSP 8 and
> place it after the "if Version['MajorVersion'] == 8: line, indented 4
> spaces. And then you would have to record the TextEx command in PSP 9
> or higher and place it after the "else:" line, indented 4 spaces. The
> two text commands are part of the if-else structure, which is entirely
> independent of the GetVersionInfo command. Granted, the "if" part of
> that structure extracts information returned by the GetVersionInfo
> command, but the if-else structure is not part of that command. It's
> just a decision-making structure used in Python, like other
> programming languages, enabling the script to take different logic
> paths based on tested values.
>
> You're right - you cannot use a Text step recorded in PSP 9 in a
> script running in PSP 8 - that's because in PSP 9 and higher, a
> text-writing action would be recorded as a TextEx command, and PSP 8
> does not recognize that command and running a script with it will
> cause PSP 8 to generate an error message.
>
>
> This is correct, JoeB.
>
> Hope I've clarified things a bit for you. Suz
>


Yes, you have clarified it substantially, so thanks for the info. Every
little bit helps :-)

By the way, I finally got off my butt and actually amended the Color
Changer script for use with 8, 9, and X by providing two versions that
actually give instructions. The first runs interactively only (unless
one wants to edit it) and has popup Message Boxes to explain to users
what dialogue is going to open and what to do with it - as well as why.
It also prints the info to the SOP.

The second version is identical except (a) it will run Interactively or
Silently depending on the Mode button toggle, and (b) it doesn't have
the Message Box popups but does output to the SOP. For people more
familiar with scripts and the SOP, they can run it interactively without
having to hit the OK button in the Message Box, and for those who know
what the script does they can run it Silently and tweak later.

I also think I have the SOP working so that even in v.9 - as long as the
SOP is stretched high enough to hold the message - the relevant print
appears whether or not the SOP is already full from previous stuff when
you start, and the last print output also appears when it it should. At
first I had problems with either the first message appearing if the SOP
was already full, and the last message wouldn't scroll up until after
the relevant dialogue was closed, so that didn't work well. Hopefully
it works fine now for everybody.

Thanks again for your help on that one also.

Regards,

JoeB
Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews