Jump to content

Insert Resources Help


ProspectComm

Recommended Posts

I need help with the rule. This is what I have.

 

Pic = CreateResource("Prepress2\\Desktop\\120-yearbook\\colorcabins" + Field("Inside Image 1") + ".tif", "graphic", true);

if (Pic.exists)

return Pic;

else

return Resource("Default Image");

 

All I get is the default image?? Where did I go wrong?

 

Rick

Link to comment
Share on other sites

I need help with the rule. This is what I have.

 

Pic = CreateResource("Prepress2\\Desktop\\120-yearbook\\colorcabins" + Field("Inside Image 1") + ".tif", "graphic", true);

if (Pic.exists)

return Pic;

else

return Resource("Default Image");

 

All I get is the default image?? Where did I go wrong?

 

Rick

You're not specifying an absolute path. Unless the graphic is in a folder relative to your job files, you need to start out with (on Windows) either a drive letter (such as "C:\\") or a UNC share (starting with two backslashes, escaped as four backslashes in JavaScript, "\\\\").

 

However, I would simply set the Search Path in the Advanced tab of the Composition Settings dialog to the location of the images, and just use the file name, sans path, in your rule, like so:

Pic = CreateResource("colorcabins" + Field("Inside Image 1") + ".tif", "graphic", true);

Link to comment
Share on other sites

Rick,

 

One other thing to note...is "colorcabins" part of the image name or is it another folder sub-level? If it's part of the image name then what you have typed is correct for the path if you include Dan's other correction of adding the four backslashes in front of the UNC name. However, if "colorcabins" is not part of the image name but an additional folder sub-level, then you need to also append two backslashes on to the end of your path name "...colorcabins\\" in order for FusionPro (or anything other program as well) to find your image path.

 

However, that only holds true if you include the path name in the rule command statement as you originally coded. If you again take Dan's suggestion and put it in the Search Path feature in the Advanced tab of the Composition Menu then you do not need the final slash marks.

.

Link to comment
Share on other sites

One other thing to note...is "colorcabins" part of the image name or is it another folder sub-level? If it's part of the image name then what you have typed is correct for the path if you include Dan's other correction of adding the four backslashes in front of the UNC name. However, if "colorcabins" is not part of the image name but an additional folder sub-level, then you need to also append two backslashes on to the end of your path name "...colorcabins\\" in order for FusionPro (or anything other program as well) to find your image path.

That's a good point. If you want to really debug this and find out what path you're telling it to load with all the backslash escapes and such, you can always put that in another JavaScript variable and use the Print function to write it to your log (.msg) file:

var FileName = "\\\\Prepress2\\Desktop\\120-yearbook\\colorcabins" + Field("Inside Image 1") + ".tif";
Print("Graphic file name: " + FileName);
var Pic = CreateResource(FileName, "graphic", true);
if (Pic.exists)
 return Pic;
//else
return Resource("Default Image");

This way, you can do a regular (non-Preview) composition, click "View Log", and then copy-and-paste the path from the log file to Windows Explorer to see if it finds the file based on your full path specification.

However, that only holds true if you include the path name in the rule command statement as you originally coded. If you again take Dan's suggestion and put it in the Search Path feature in the Advanced tab of the Composition Menu then you do not need the final slash marks.

Yes, I still recommend this approach.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...