• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Retrieving desired file name in fileFormat plugin

Guest
Apr 05, 2011 Apr 05, 2011

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...

TOPICS
SDK

Views

691

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Apr 05, 2011 Apr 05, 2011

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. */

Votes

Translate

Translate
Adobe
Adobe Employee ,
Apr 05, 2011 Apr 05, 2011

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. */

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 06, 2011 Apr 06, 2011

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines