Jump to content

Can't get Relative Paths to work in Resource Editor


Recommended Posts

Hello,

FusionPro Creator 13.0.2 on an M1 Mac running Monterey 12.4, and Windows servers running FusionPro Producer and Server.

I'm having trouble getting relative paths to work in the Resource Editor.

My template PDF is in a folder called "working". Also in the working folder is a folder called "Links", and in the Links folder is a file called "Signature.pdf". When I set up a new graphic resource in the Resource Editor, I manually navigate to the Signature.pdf file, hit OK, and it shows the full path. Great. However, when I replace everything up to and including the working folder with a dot so it looks like this:

./Links/Signature.pdf

and hit OK, it pops an error window that the "File does not exist." I have tried all kinds of variations of one dot, two dots, colons, slashes... I can't seem to get it to work. What am I missing?

Thanks in advance for any suggestions.

SigPath.pdf DoesNotExist.pdf

Link to comment
Share on other sites

Drewstre,

I don't think you can use a relative path in the Resource Editor. The resource has to be linked directly to it's location when you choose it during the add resource process.

 

ScreenShot2023-06-21at5_05_36PM.png.25ae7679e4c8ac62073b6a5cdeddc121.png

 

Then you need to but the relative path in the Composition Settings - Advanced tab Search Paths but you don't need the ./ just the name of the sub folder. In your case just Links.

Here is an excerpt that helps explain it from the following link:  https://forums.pti.com/topic/1198-relative-file-paths/#comment-4810

 

jurgmay said:
At the moment all my resources have to be placed inside the same folder as my template file which I'd like to avoid. What I'd like to do is have a folder within my template's parent folder titled 'Resources'. In my code I would reference it something like '~/Resources/' where the ~ will be the path to the parent folder of my template file.

 

Ideally my folder structure would be something like...

 

TEMPLATE FOLDER (Parent Folder)

INPUT (Child of TEMPLATE FOLDER)

OUTPUT (Child of TEMPLATE FOLDER)

RESOURCES (Child of TEMPLATE FOLDER)

 

All my resources would be places in the RESOURCES folder and all output files would appear in the OUTPUT folder.

 

It seems though that I have to either set the Search Path (through Compose > Advanced) or hard code the FULL file path. Both of these options mean I have to determine a static path rather than a dynamic one.

That's not entirely true. If you merely want to reference resources in a subfolder of your template folder, all you need to do is type that folder's name in the "Search Path" box on the Advanced tab of the Composition Settings dialog. Not a relative path with dots and slashes and such, just the folder name, i.e. "RESOURCES". That's all you need. Then any calls to file names in functions like CreateResource will automatically search that folder. The key here is that "RESOURCES" is a relative path; it's the same as "./RESOURCES" (or ".\RESOURCES", or even ":RESOURCES" in the old HFS-style specification on Mac).

 

You can also type other relative path specifications in the "Search Path" box. For instance, typing "../RESOURCES" there will reference a folder that's a sibling of your template folder. And ".." will reference the parent folder of your template folder.

 

Note also that you can enter multiple paths in the "Search Path" box, using semicolons to delimit them. So you can type something like "Graphics;../Graphics;../data" and all of those folders will be searched, in order (after the input and format/template file folders, which are always searched first, as I noted in my previous post).

-----------------------------------

Hope this helps.

Link to comment
Share on other sites

Why are you trying to use a relative path in the first place?

The path is probably being stored as relative if you look in the .def file, and it will be found at composition time.  But it will show as an absolute path in the resource editor, mostly because the File dialog needs to deal with full paths.

So, it's not clear me me what you're trying to accomplish with a relative path in the editor.  Is something not working when you specify the full path?

Keep in mind that, if you're using Producer or Server to compose jobs, you probably want to be referencing your resources from a shared location, like a UNC path on Windows, or a Samba file share on Mac, and you want to keep that "Upload graphic files to FusionPro Producer" box unchecked when you submit a job to Producer.  Otherwise, your graphics all get re-uploaded as copies every time.

Link to comment
Share on other sites

Thanks guys, I appreciate you both for taking the time to reply to my inquiry.

We have several recurring jobs that we do every week or every month. We use Prinergy to create and organize all of our job folders, and all of the assets for all of our jobs are contained within the individual job folders that Prinergy creates. When one of these recurring jobs comes around, we change the name of the job in Prinergy from the previous job number to the new job number, which changes the name of the job folder containing all of the assets. This is where the relative paths would come in very handy. Since FusionPro seems to have pretty robust (and useful) support for relative paths, I just assumed they could be used in the Resource Editor, and thought I didn't have my syntax right.

On 6/22/2023 at 1:38 PM, Dan Korn said:

Keep in mind that, if you're using Producer or Server to compose jobs, you probably want to be referencing your resources from a shared location, like a UNC path on Windows, or a Samba file share on Mac, and you want to keep that "Upload graphic files to FusionPro Producer" box unchecked when you submit a job to Producer.  Otherwise, your graphics all get re-uploaded as copies every time.

That's the plan eventually, to migrate as many jobs as possible to Producer/Server, but we're not there yet... it will require a bit of a shift in workflow to have all of our resources in a location accessible by the boxes running Producer/Server.

Thanks again for your help gentlemen.

Link to comment
Share on other sites

2 hours ago, Drewstre said:

We have several recurring jobs that we do every week or every month. We use Prinergy to create and organize all of our job folders, and all of the assets for all of our jobs are contained within the individual job folders that Prinergy creates. When one of these recurring jobs comes around, we change the name of the job in Prinergy from the previous job number to the new job number, which changes the name of the job folder containing all of the assets. This is where the relative paths would come in very handy. Since FusionPro seems to have pretty robust (and useful) support for relative paths, I just assumed they could be used in the Resource Editor, and thought I didn't have my syntax right.

In this case, you want to specify the relative path in the Search Path box on the Advanced tab of the Composition Settings dialog.  Multiple paths there can be delimited with semicolons.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...