Paths are represented differently on Macintosh and Windows machines. This has an impact when working in a cross-platform environment as a picture import path configured on Macintosh would not work on Windows and vice-versa.
To overcome this, a Custom Field command can be used to determine the platform that EasyCatalog is running on:
1 | IF(ENV(platform),=,Macintosh,'Macintosh HD:Images','C:\Images') |
The ‘ENV‘ command takes a single parameter, and returns environmental information about EasyCatalog. In this case, the ‘platform’ option has been specified, and the command will return either ‘Macintosh’ or ‘Windows’. Based on the result of this we then either construct a Macintosh or Windows-type path.
The Custom Field command can be entered directly into the Location field in Field Options:
Alternatively, a new custom field can be created in the panel. This is useful for when the path is referenced by multiple picture fields. To create a Custom Field:
- Right click in the panel and use the “New Custom Field” option from the pop-up menu
- Give the new field a name at the top of the panel
- In the Content area, enter the custom field command:
1 | IF(ENV(platform),=,Macintosh,'Macintosh HD:Images','C:\Images') |