Copy link to clipboard
Copied
Hello all!
I'm having trouble finding out how to retrive the desierd file name in my experimental file format plugin. I've used SimpleFormat as a starting point and after i tracked down the datastructure of the file I'm supposed to write, all I can find is a handle to a write descriptor. Dead end as far as i coul'd see.
The thing is, I need to manipulate the file from another process outside of photoshop, and therefor I need to communicate the name of the file the user saved out of the plugin to be used at a later time.
It seems to me the process of file handeling is designed to be opaque?
Edit; oh I forgot, this is on OS X...
PIFormat.h version 11 (Photoshop CS4) added this item to the record.
uint16 *finalSpec;
/**< A utf16 encoded string that contains the location of the final file. Use this for reference only.
This will give you the parent folder and the name of the final file.
Read and write via the @ref fileSpec2 only and not this value. */
Copy link to clipboard
Copied
PIFormat.h version 11 (Photoshop CS4) added this item to the record.
uint16 *finalSpec;
/**< A utf16 encoded string that contains the location of the final file. Use this for reference only.
This will give you the parent folder and the name of the final file.
Read and write via the @ref fileSpec2 only and not this value. */
Copy link to clipboard
Copied
Thank you!
Although I'm a wee bit confused about how to read the value from fileSpec2, as I mentioned in the OP it ends up in a hidden[80] array.
I did it like this, contrary to the instructions in the .h:
UInt16 *finalSpec = gFormatRecord->finalSpec;
unichar *_fs = (UniChar*)finalSpec;
NSString *destination = [NSString stringWithFormat:@"%S", _fs];
And it works fine, so i marked this thread as answered even though it might be a bit naughty