Note you can extend this to deal with different file types. But it should get you rolling. Replace the bracketed part with the actual file name or a field or expression that results in the file name.
fileName = <fileName or field you have the fileName stored> ;
pos = Position ( fileName ; ".jpg" ; 1 ; 1 ) - 1
Left ( fileName ; pos )
Or you could change your calc to Substitute(GetContainerAttribute ( Images ; Style_Number );".jpg";""). This will remove the .jpg
Thank you for your input. Where exactly would this calculation be placed in the solution?
You are missing the Substitute( at the beginning of the calc.
The text is the calc or field that gives you the file name with the .jpg, the Searchstring is ".jpg" and the ReplaceString is "".
Thanks for helping but I need to look at this later. Still can't figure this out.
I owe you a coffee.
It would be makeing another calculation field.
If you use existent "Number Text" field, set the auto-enter calculation as
Left ( Self ; Length ( Self ) - Case ( Right ( Self ; 4 ) = ".jpg" ; 4 ) )
and use "Perform auto-enter" option while importing.
This has been working fine for a few months as I eventually got it to work.
Now what I need to do is an exact reversal of the original post. My users want to use the images in a PPT file so when they click on the export button I need the files to have a jpg appended to the file name now.
Is there a way I may be able to do this?
The full file name with extension is still part of the data in the container. Get Container Attribute can return that file name.
Ok thanks philemodjunk.
Now I have to figure out how to put the export script together.
use set variable to assign a file path to that variable. This should include the file name of the file in the container.
Use export field contents, but type in the name of the variable in place of an actual file path and name.
So everything now exports nicely into my 'Shoe Images' folder with the .jpg file extension added. That's when using a Mac. Now testing this on a Windows PC the file extension is not there.
I have attached the script with the calc. Is there something I need to add to make this work on a PC machine?