Jump to content

Getting Multiple Values from GetContainerAttribute in one Field?


This topic is 1409 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm trying to get a field to show me:

(Image Width)
            x
(Image Height)

Using a calculation for the field content I can get one or the other.

Let (
a = GetContainerAttribute ( ISBN_Cover ; "width" ) ;
a
)

So I'm thinking something along the lines of (below) -which obviously does not work- But how do I..

Let (
a = GetContainerAttribute ( ISBN_Cover ; "width" ) ;
b = GetContainerAttribute ( ISBN_Cover ; "height" ) ;
a & ¶ & "x" & ¶ & a
)

In the process of posting this question, it occurred to me, "the other side of the semi-colon is the output, but what about embedding another calculation in there too?"
...and that worked.

So:
 

Let (
a = GetContainerAttribute ( ISBN_Cover ; "width" ) ; Let (
b = GetContainerAttribute ( ISBN_Cover ; "height" ) ;
a & ¶ & "x" & ¶ & b
))

Gives me what I want.  (Image Dimensions next to the image)

539288020_ScreenShot2020-06-11at05_02_47.png.f6f76e0797c73ce78243e4d9fab427b7.png1550270379_ScreenShot2020-06-11at05_06_36.png.04187564976946a47641f8b81309bbdf.png

Would there a "better" way to do this kind of thing? ...

Link to comment
Share on other sites

25 minutes ago, Tony Diaz said:

So I'm thinking something along the lines of (below) -which obviously does not work- But how do I..


Let (
a = GetContainerAttribute ( ISBN_Cover ; "width" ) ;
b = GetContainerAttribute ( ISBN_Cover ; "height" ) ;
a & ¶ & "x" & ¶ & a
)

 

It doesn't work, because multiple variable assignments within the same Let statement must be enclosed in square brackets:

Let ( [
a = GetContainerAttribute ( ISBN_Cover ; "width" ) ;
b = GetContainerAttribute ( ISBN_Cover ; "height" ) 
] ;
a & ¶ & "x" & ¶ & b
)

Of course,

a & ¶ & "x" & ¶ & b

could be shortened to:

a & "¶x¶" & b

or (perhaps preferably):

Let ( [
w = GetContainerAttribute ( ISBN_Cover ; "width" ) ;
h = GetContainerAttribute ( ISBN_Cover ; "height" ) 
] ;
List ( w ; "x" ; h )
)

 

Edited by comment
Link to comment
Share on other sites

This topic is 1409 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.