dbTalk Databases Forums  

Scripting file paths for container fields

comp.databases.filemaker comp.databases.filemaker


Discuss Scripting file paths for container fields in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael Paine
 
Posts: n/a

Default Scripting file paths for container fields - 11-05-2005 , 02:50 PM






As noted previously, I am working on a layout/script that will populate
container fields with coloured pictures that depend on other fields in
the table. I was hoping to do this by using the Insert Picture script
step and assign a variable to the image file path and name (eg
"image:/pics/" & tableicname ). However I couldn't get this to work. I
eventually found the following reference in FM8 help:
"Variables are not supported in file paths that are stored in container
fields"

I can work around the problem with a long sequence of IF ELSE statements
but it would have been much simpler if variable file paths were supported.

Another example would be using script to select an employee picture
using employee number (to avoid users having to manually select from
folder listings).

Any suggestions for a workaround?

Michael Paine

Reply With Quote
  #2  
Old   
Matt Wills
 
Posts: n/a

Default Re: Scripting file paths for container fields - 11-05-2005 , 03:08 PM






Michael Paine wrote on (11/5/2005):

Quote:
"Variables are not supported in file paths that are stored in container
fields"
If that's saying what I think it's saying, I would have to say, "That
sucks."

I routinely use a calculated path to an image (including field values as
variables) returned as a container to display the image (this in FM7).

Are you telling me they took that capability away?

That would contradict the oft-expressed assertion that FM8 files are fully
functional in FM7 except for FM8-specific features.

Matt


Reply With Quote
  #3  
Old   
ursus.kirk
 
Posts: n/a

Default Re: Scripting file paths for container fields - 11-05-2005 , 04:31 PM



The calculated conatiners containing references to images do still work as
expected. And these calculations still contain references to fields. And
the contaents of these fields differ from record to record.

Thus the next calc does have an image as result: "image:./images/" &
ArtistID & "_01.jpg"

Ursus

"Matt Wills" <I'm (AT) Witz (DOT) end> schreef in bericht
news:Va9bf.133$w_6.10 (AT) trndny09 (DOT) ..
Quote:
Michael Paine wrote on (11/5/2005):

"Variables are not supported in file paths that are stored in container
fields"

If that's saying what I think it's saying, I would have to say, "That
sucks."

I routinely use a calculated path to an image (including field values as
variables) returned as a container to display the image (this in FM7).

Are you telling me they took that capability away?

That would contradict the oft-expressed assertion that FM8 files are fully
functional in FM7 except for FM8-specific features.

Matt



Reply With Quote
  #4  
Old   
Matt Wills
 
Posts: n/a

Default Re: Scripting file paths for container fields - 11-05-2005 , 04:45 PM



OK, then, I guess I completely misunderstood what Michael was saying.

Whew. I was worried I would have to redesign this thing when I upgraded it
to 8.

Michael, can you elaborate?

Matt

ursus.kirk wrote on (11/5/2005):

Quote:
The calculated conatiners containing references to images do still work as
expected. And these calculations still contain references to fields. And
the contaents of these fields differ from record to record.

Thus the next calc does have an image as result: "image:./images/" &
ArtistID & "_01.jpg"

Ursus

"Matt Wills" <I'm (AT) Witz (DOT) end> schreef in bericht
news:Va9bf.133$w_6.10 (AT) trndny09 (DOT) ..
Michael Paine wrote on (11/5/2005):

"Variables are not supported in file paths that are stored in container
fields"

If that's saying what I think it's saying, I would have to say, "That
sucks."

I routinely use a calculated path to an image (including field values as
variables) returned as a container to display the image (this in FM7).

Are you telling me they took that capability away?

That would contradict the oft-expressed assertion that FM8 files are fully
functional in FM7 except for FM8-specific features.

Matt


--



Reply With Quote
  #5  
Old   
Michael Paine
 
Posts: n/a

Default Re: Scripting file paths for container fields - 11-05-2005 , 05:50 PM



The script below did not work as I expected (one problem may be that the
global variable $$pic is not recognised within the insert picture
statement (it automatically puts quotes around it). When I checked Help
it came up with the limitation I mentioned before

Enter Browse Mode
Go to Layout [ “fancy_test” (Vehicles) ]
Set Variable [ $$pic; Value:"imageics/" & Vehicles::head_drv_colour ]
Go to Field [ Vehicles::head_drv_pic ]
Insert Picture [ “$$pic” ]
[ Reference ]


I will try
Insert Picture [ "imageics/" & Vehicles::head_drv_colour ]
However, my logic would be greatly simplified if I could use a global
variable in the script.

Michael Paine

Matt Wills wrote:
Quote:
OK, then, I guess I completely misunderstood what Michael was saying.

Whew. I was worried I would have to redesign this thing when I upgraded
it to 8.

Michael, can you elaborate?

Matt

ursus.kirk wrote on (11/5/2005):

The calculated conatiners containing references to images do still
work as expected. And these calculations still contain references to
fields. And the contaents of these fields differ from record to record.

Thus the next calc does have an image as result: "image:./images/" &
ArtistID & "_01.jpg"

Ursus

"Matt Wills" <I'm (AT) Witz (DOT) end> schreef in bericht
news:Va9bf.133$w_6.10 (AT) trndny09 (DOT) ..

Michael Paine wrote on (11/5/2005):

"Variables are not supported in file paths that are stored in
container fields"


If that's saying what I think it's saying, I would have to say,
"That sucks."

I routinely use a calculated path to an image (including field values
as variables) returned as a container to display the image (this in
FM7).

Are you telling me they took that capability away?

That would contradict the oft-expressed assertion that FM8 files are
fully functional in FM7 except for FM8-specific features.

Matt





Reply With Quote
  #6  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: Scripting file paths for container fields - 11-05-2005 , 06:08 PM



Michael Paine wrote:
Quote:
As noted previously, I am working on a layout/script that will populate
container fields with coloured pictures that depend on other fields in
the table. I was hoping to do this by using the Insert Picture script
step and assign a variable to the image file path and name (eg
"image:/pics/" & tableicname ). However I couldn't get this to work. I
eventually found the following reference in FM8 help:
"Variables are not supported in file paths that are stored in container
fields"

I can work around the problem with a long sequence of IF ELSE statements
but it would have been much simpler if variable file paths were supported.

Another example would be using script to select an employee picture
using employee number (to avoid users having to manually select from
folder listings).

Any suggestions for a workaround?
I see no reason you can't set a variable to "image:/pics/" &
tableicname, and then use that variable in the 'filename' for the
Insert Picture step. Is that what you have tried and you are saying failed?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance


Reply With Quote
  #7  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: Scripting file paths for container fields - 11-05-2005 , 06:36 PM



Michael Paine wrote:
Quote:
The script below did not work as I expected (one problem may be that the
global variable $$pic is not recognised within the insert picture
statement (it automatically puts quotes around it). When I checked Help
it came up with the limitation I mentioned before

Enter Browse Mode
Go to Layout [ “fancy_test” (Vehicles) ]
Set Variable [ $$pic; Value:"imageics/" & Vehicles::head_drv_colour ]
Go to Field [ Vehicles::head_drv_pic ]
Insert Picture [ “$$pic” ]
[ Reference ]
I just tried the equivalent of this and it worked:
Set Variable [ $$pic; Value:"image:/pics/" & Vehicles::head_drv_colour ]
Go to Field [ Vehicles::head_drv_pic ]
Insert Picture [ “$$pic” ]

Note the extra slash after image:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance


Reply With Quote
  #8  
Old   
Michael Paine
 
Posts: n/a

Default Re: Scripting file paths for container fields - 11-06-2005 , 02:01 AM



Thanks Howard. I will try it again. Maybe the Help text is out of date?
Michael Paine

Howard Schlossberg wrote:

Quote:
Michael Paine wrote:

The script below did not work as I expected (one problem may be that
the global variable $$pic is not recognised within the insert picture
statement (it automatically puts quotes around it). When I checked
Help it came up with the limitation I mentioned before

Enter Browse Mode
Go to Layout [ “fancy_test” (Vehicles) ]
Set Variable [ $$pic; Value:"imageics/" & Vehicles::head_drv_colour ]
Go to Field [ Vehicles::head_drv_pic ]
Insert Picture [ “$$pic” ]
[ Reference ]


I just tried the equivalent of this and it worked:
Set Variable [ $$pic; Value:"image:/pics/" & Vehicles::head_drv_colour ]
Go to Field [ Vehicles::head_drv_pic ]
Insert Picture [ “$$pic” ]

Note the extra slash after image:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance

Reply With Quote
  #9  
Old   
Matt Wills
 
Posts: n/a

Default Re: Scripting file paths for container fields - 11-06-2005 , 07:26 AM



OK,understood. A script variable thing in 8.

I mistook you to be saying that we could no longer use a calculated path
to include an image by reference.

Would it simplify things for you if you were to do it that way instead of
by a scripted insert, or does the image actually have to be in the
FileMaker file?

Matt

Michael Paine wrote on (11/5/2005):

Quote:
The script below did not work as I expected (one problem may be that the
global variable $$pic is not recognised within the insert picture
statement (it automatically puts quotes around it). When I checked Help it
came up with the limitation I mentioned before

Enter Browse Mode
Go to Layout [ “fancy_test” (Vehicles) ]
Set Variable [ $$pic; Value:"imageics/" & Vehicles::head_drv_colour ]
Go to Field [ Vehicles::head_drv_pic ]
Insert Picture [ “$$pic” ]
[ Reference ]


I will try
Insert Picture [ "imageics/" & Vehicles::head_drv_colour ]
However, my logic would be greatly simplified if I could use a global
variable in the script.

Michael Paine

Matt Wills wrote:
OK, then, I guess I completely misunderstood what Michael was saying.

Whew. I was worried I would have to redesign this thing when I upgraded
it to 8.

Michael, can you elaborate?

Matt

ursus.kirk wrote on (11/5/2005):

The calculated conatiners containing references to images do still work
as expected. And these calculations still contain references to fields.
And the contaents of these fields differ from record to record.

Thus the next calc does have an image as result: "image:./images/" &
ArtistID & "_01.jpg"

Ursus

"Matt Wills" <I'm (AT) Witz (DOT) end> schreef in bericht
news:Va9bf.133$w_6.10 (AT) trndny09 (DOT) ..

Michael Paine wrote on (11/5/2005):

"Variables are not supported in file paths that are stored in container
fields"


If that's saying what I think it's saying, I would have to say, "That
sucks."

I routinely use a calculated path to an image (including field values as
variables) returned as a container to display the image (this in FM7).

Are you telling me they took that capability away?

That would contradict the oft-expressed assertion that FM8 files are
fully functional in FM7 except for FM8-specific features.

Matt






--



Reply With Quote
  #10  
Old   
Michael Paine
 
Posts: n/a

Default Re: Scripting file paths for container fields - 11-06-2005 , 04:32 PM



I have tried the suggested method and other variations (with and without
the "/" before pic) without success. I have even tried using a dialog
box to check that the $$pic string is correct before the Go to Field step.

I can combine path and field value in the Insert Picture (as suggested
by Ursus) but just using a global variable $$pic does not seem to work.
Also mixing $$pic with a field value gives an error message in Scriptmaker.

Since I can obtain the desired output with IF ELSE statements I will go
that way for now. Thanks for the suggestions but I dont have time to
experiment more.

Michael Paine




Michael Paine wrote:
Quote:
Thanks Howard. I will try it again. Maybe the Help text is out of date?
Michael Paine

Howard Schlossberg wrote:

Michael Paine wrote:

The script below did not work as I expected (one problem may be that
the global variable $$pic is not recognised within the insert picture
statement (it automatically puts quotes around it). When I checked
Help it came up with the limitation I mentioned before

Enter Browse Mode
Go to Layout [ “fancy_test” (Vehicles) ]
Set Variable [ $$pic; Value:"imageics/" & Vehicles::head_drv_colour ]
Go to Field [ Vehicles::head_drv_pic ]
Insert Picture [ “$$pic” ]
[ Reference ]



I just tried the equivalent of this and it worked:
Set Variable [ $$pic; Value:"image:/pics/" & Vehicles::head_drv_colour ]
Go to Field [ Vehicles::head_drv_pic ]
Insert Picture [ “$$pic” ]

Note the extra slash after image:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.