View Single Post
  #3  
Old July 7th, 2015, 04:06 PM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: Return an Image value Based on the Value of a Selected Image?

Your problem sounds pretty similar to this thread. I'd bet with a few tweaks, the same solution would work for you:
Code:
var header = String(GetFileName(Field("Cover Image")).match(/(sunset_fade|waterfall|starry_sky)\.pdf/ig));
var color = '';

switch (ToLower(header)){
    case "sunset_fade.pdf":
        color = "Red";
        break;
     case "waterfall.pdf":
        color = "Blue";
        break;
     case "starry_sky.pdf":
        color = "Purple";
        break;
    default:
        color = "Gray";
}

return Resource("Backer_" + color + ".pdf");
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote