Jump to content

file existance issue


Recommended Posts

I am currently using this forloop on a MarcomCentral template that works perfect on my desktop. The issue that i am gathering is that when we (the users) delete a file in the library in references the file itself is not deleted but remitted to some sort of inactive status.....This is all fine and dandy but for some of us that use sequential or sku based file naming systems, that can be a nightmare. Does it make sense for MarcomCentral to keep the file we chose to delete in the directory and allow it to be reference by our JavaScript (if that is the case).:mad:

 

I am trying to preview CPM1026-10 below but i keep getting CPM1026-08 since it "stops" at the existence of CPM1026-08. A try catch will not work either. I cannot think of another file object i can use to reference the correct file.

 

Type = "CPM"; //CHANGE FOR EVERY TEMPLATE
for (i = 7; i <= 10; i++){
var number1 = i;
var count1 = 2;
var Year = "-" + zeroPad(number1,count1);
FrontImage = CreateResource(ImagePath + Type + Front + dynaccount + Year + ".pdf", "graphic", true);
if (FrontImage.exists)       
   return FrontImage;
} 

Link to comment
Share on other sites

When working with Graphic Resources in MacomCentral, you don't want to include an image path because it is created as the assets are upload to your library. As long as the images are linked to the template in MarcomCentral, they are available.

 

In your code, I am not sure where the "Front" or "dynaccount" variablea are coming from, so I assume they are declared in the Javascript Globals. I suggest altering the rule to exclude the ImagePath:

 

FrontImage = new FusionProResource(Type + Front + dynaccount + Year + ".pdf", "graphic", true);

 

..and making sure to link the desired library images with the template in the Images tab.

 

When you need assistance from Printable, please make sure to contact us directly through email:

support@pti.com or gfx@pti.com or by phone at 800-220-1727.

 

Please email gfx@pti.com if you need more help with this template.

 

Shawn Herris

Graphic Engineer | PTI Marketing Technologies | Printable Technologies Inc.

gfx@printable.com | linkssupport@printable.com

www.pti.com | 800.220.1727 office

Visit the all new Printable User Community today!

http://forums.printable.com

MarcomCentral® is the Premiere Web-Based Marketing Asset Management Solution that Provides Unparalleled Brand Control

This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. If you are the intended recipient, please be advised that the content of this message is subject to access, review and disclosure by the sender's Email System Administrator.

Link to comment
Share on other sites

Shawn, I get the jest of what you are saying but that still has nothing to do with the fact that if I delete an image (Example: CPS1069-08) from the MarcomCentral Library and then upload a file (Example: CPS1069-10), i am getting the CPS1068-08 asset upon composition. The loop i wrote checks for the existence of CPS1069-07, CPS1069-08, CPS1069-09, and CPS1069-10 as you can see. The issue i surmise, is that it is stopping at CPS1069-08 because even though i deleted CPS1069-08 from the MarcomCentral Library and loadedCPS1069-10, CPS1069-08 is not really deleted but simply deactivated or something of that sort. Know what i mean?
Link to comment
Share on other sites

Hi Hadrian,

 

Please send the template along with your Store name and Product ID to gfx@pti.com for troubleshooting. We can provide a more accurate solution after reviewing the actual files.

 

Shawn Herris

Graphic Engineer | PTI Marketing Technologies | Printable Technologies Inc.

gfx@printable.com | linkssupport@printable.com

www.pti.com | 800.220.1727 office

Visit the all new Printable User Community today!

http://forums.printable.com

MarcomCentral® is the Premiere Web-Based Marketing Asset Management Solution that Provides Unparalleled Brand Control

This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. If you are the intended recipient, please be advised that the content of this message is subject to access, review and disclosure by the sender's Email System Administrator.

Link to comment
Share on other sites

I just figured it out.....feel a bit stupid....reverse the loop to check from the bigger padded number to the smallest....sigh

Woops. Not working when i reverse the loop. In fact, it is crashing FusionPro. Anyone have any clues?

If you're counting backwards from a larger number to a smaller number, you need to decrement with the -- operator instead of incrementing with the ++ operator. Like this:

for (i = 10; i >= 7; i[color=Green]--[/color])

Basically, you were in an infinite loop. You started at 10 and kept adding, so it was never less than 7.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...