CS2/CS3/CS4: Cannot get file path in Unicode of the current document on Windows

Hi All,
In my automation plugin I need to have full absolute path of the opened document with any possible non-English letters. Using SDK examples Listener and Getter that come with Photoshop SDK the full absolute path which I obtain is in the default ANSI code page (CP_ACP) and I can convert it to Unicode using MultiByteToWideChar() API. However this works well when I have corresponding to document name language set in the "Control Panel -> Regional and Language Options -> Advanced -> Select a language to match the language version of the non-Unicode programs you want to use." For example if name of the document has Russian letters and chosen language in "Regional and Language Options" is also Russian the described conversion works well. If I change "Regional and Language Options" to English for example, full path returned by Photoshop SDK API (AliasToFullPath in PIUFile.cpp) for the document with Russian letters will contain "????????.psd" symbols.
So I need to have an ability to get absolute file path in Unicode. Is it possible in Photoshop CS2/CS3/CS4 for Windows? I have searched forum and SDK but could not find info on it.
Is it possible to have native HANDLE of the opened file to get file info using Windows API?
Please advice.
Below given slightly modified code from Photoshop CS3 which I use to get absolute file pat of the opened document.
Thanks and regards,
Sergey
std::string outFilePath;
int32 theID = 0;
SPErr error = kSPNoError;
error = PIUGetInfo(classDocument, keyDocumentID, &theID, NULL);
if (error == kSPNoError)
Handle theFileHandle = NULL;
error = PIUGetInfoByID(theID, classDocument, keyFileReference, &theFileHandle, NULL);
if (error == kSPNoError)
int32 length = sPSHandle->GetSize(theFileHandle);
Boolean oldLock = FALSE;
Ptr pointer = NULL;
sPSHandle->SetLock(theFileHandle, true, &pointer, &oldLock);
if (pointer != NULL)
outFilePath = (char*)pointer;
sPSHandle->SetLock(theFileHandle, oldLock, &pointer, &oldLock);

Hi All,
Does anybody know, whether it is possible to get Unicode file path of the current document in Photoshop via Photoshop SDK API or without them?
Thanks,
Serhiy

Similar Messages

  • How do I get the full path and filename of the current document?

    I'm writing a format plug-in. How do I obtain the full path and filename of the current image (document) from within my plug-in? Any help would be greatly appreciated!

    I actually just figured this out. For anyone else who would like to know, check out the propetizer sample code in the photoshop sdk. It makes a "filter" plug-in that just spits out all the properties of the document you could ever want to know about. The function I used to get the full path and filename of the current document is PIGetDocumentName(). I hope this helps someone eventually...

  • Manage multiple versions(ID CS,CS2,CS3,CS4) of INDD files Indesign proxy for PC

    Dear scripters,
    I have multiple version of ID installed in my system. I have ID CS,CS2,CS3 and CS4. While I am opening (double click) the ID CS file, automatically the file opening in CS4. For solving this problem I have searched in the forums I found there is a program called INDESIGN PROXY for MAC OSX. It manages the problems well.
    Now I am in the process of developing the application same like that for windows using VB. Here is my observation about Indesign proxy.
    1. While user double clicks the Indesign file the argument is not passing to the Indesign.exe, but the argument passes to the Indesign proxy. Something like this
    "C:\Program Files\Adobe\Adobe InDesign CS4\InDesign.exe" "%1"
    to this
    "C:\Program Files\IDproxy\proxy.exe" "%1"
    2. The proxy exe lists all the version of IDs in a dialog box. If user selects CS2, the proxy exe passes the command argument something like this
    "C:\Program Files\Adobe\Adobe InDesign CS2\InDesign.exe" "%1"
    3. Now the file will open in correct version.
    I am comfort with VB forums and coding but I am struck getting the file path while user double click's the file. I short need to get the file path of "%1" argument.
    I think I am detailed.
    Kindly advice me how can I proceed more?
    Thanks
    regards
    a r u l
    vpublish.net

    I don't think it's a mistake.
    "InDesign CS4 (3.0)"
    means: this is the OM for InDesign 3.0 (i.e., InDesign CS) that is contained in InDesign CS4.
    Wait -- do you mean there might be a difference between "the OM for InDesign 4.0 (i.e., InDesign CS2) that is contained in InDesign CS4" and, say, "OM for InDesign 4.0 (i.e., InDesign CS2) that is contained in InDesign CS5" ?
    Why on earth would anyone need that? I imagine it's not because even with versioning the 'older' scripts may not behave the same -- there must be dozens of mails about versioning not working ... I mean, if Adobe knows what causes older scripts to stop working (because, if I understand you correctly, they retroactively change it in the documentation for older versions), wouldn't it be yet easier to not cause those changes?

  • Robohelp 7 HTML cannot get files with accented characters in the name

    The files are added without a problem but "Get" operation
    returns error "invalid file name"
    Example of the file name Le_système.htm or
    Aperçu_du_système.htm

    I got a similar response when RSC didn't like some of the
    special characters (punctuation) that sneaked into some of our
    files. Your other files operate normally, right? I'd report this to
    Adobe as a bug.
    G

  • I cannot get anything to download...the upper-left corner window to double-click after clicking on the RUN or SAVE window does not appear.

    This occurred after I stupidly removed some programs I thought unneeded to free up space.

    You are fantastic!!!I Did the "reset Firefox", and now I can download, the download window appears with something in it to double-click, and everything! Thank you...I have spent hours, days and months, many "help" sites, and a lot of frustration trying to get this to work; have spent over 6 hours just tonight trying sites that didn't work, and most of whom wanted to charge my grocery $ amount to get me to Premium Support techs. Thank you!

  • Bug when getting file path in non-english Windows Vista

    Hello,
    I'm getting an error when trying to get the file path of a video in a non-english Windows Vista... The code is:
    var file = "video.flv"
    var filePath = air.File.applicationStorageDirectory.resolvePath(file);
    filePath = filePath.nativePath;
    The filePath variable is used later by a flash video player to load the video file..
    In the brazilian Windows Vista the path of the StorageDirectory would be something like "C:\Usuários\(user name)\..." but if I run this script it returns "C:\Users\(user name)\..." as the native path.
    The problem seems to be in the "nativePath" function, cause I'm able to copy files to the app-storage folder using the "air.File.appicationStorageDirectory.resolvePath()" method without any problems.
    I could insert a small code which substitutes "Users" with "Usuários" but then it wouldn't work on an english Vista...
    Any ideas on this? Is there a way to check the language of the operating system in Air so to act accordingly?
    Thanks for any help!

    Hello,
    has anybody found a solution?
    Testcase: SQL Developer 3.1 on a German XP with default NLS Settings
    CREATE TABLE "TEST_TABLE"
           "NUM" NUMBER
          ,"VCH"  VARCHAR2(10 BYTE)
        ) ;Test file test_insert.dsv
    num;vch
    1;KL
    1,5;tz
    12345,45;ooImporting using the wizard inserts the first row correctly, for the others I get
    SET DEFINE OFF
    --Einfügen für Zeilen  1  bis  3  nicht erfolgreich
    --ORA-01722: invalid number
    --Zeile 2
    INSERT INTO TEST_TABLE (NUM, VCH) VALUES (1.5,'tz');
    --Zeile 3
    INSERT INTO TEST_TABLE (NUM, VCH) VALUES (12345.45,'oo');Beside the wrong umlaut in the message the insert statement itself is correct, because you cannot use the german decimal separator "," in the script. The bug is, that it should use the same NLS settings for generating and running the script.
    Regards
    Marcus

  • All copies illustrator crash, cs2 cs3 cs4 Leopard 10.5.8 powermac 1.8 dual

    I crashes every time i open it. it suddenly started happening. i could get just past  the opening pane at first allowing me to choose what kind of document to open print rgb etc, the it stopped doing that. i get the opening pane the it crashes, it aslo happens in past copies cs2 cs3 cs4 non of my illustrator copies will open

    It could be an issue with your font caches.  Go get fontnuke and try deleting all your system and application font caches.
    It doesn't sound like a preference issue if it's affecting all the other versions.  Do you have the suite installed?  Is Photoshop working properly?

  • PREPARE UPLOAD_REQUEST CANNOT GET FILE LIST

    Hello all,
    In the PREPARE, phase UPLOAD_REQUEST, received error 'CANNOT GET FILE LIST OF '..EPS\in.. folder.
    Log UPLOADREQ.LOG has the followin. Search in SDN and SAP did not get any result.
    1 ETQ201XEntering upgrade-phase "UPLOAD_REQUEST" ("20081126150332")
    2 ETQ367 Connect variables are set for standard instance access
    4 ETQ399 System-nr = '60', GwService = 'sapgw60'
    4 ETQ399 Environment variables:
    4 ETQ399   dbs_db2_schema=SAPR3
    4 ETQ399   auth_shadow_upgrade=0
    4 ETQ399 Directory 'd:\usr\BZ3put\eps' not found.
    4 ETQ399 Skipping copy of OCS packages.
    2 ETQ730 Starting upload of all package files in "
    ustcf001\patches\EPS\in"
    4 ETQ010 Date & Time: 20081126150339 
    4 ETQ230 Starting RFC Login to: System = "BZ3", GwHost = "ustwa356", GwService = "sapgw60"
    4 ETQ359 RFC Login to: System="BZ3", Nr="60", GwHost="ustwa356", GwService="sapgw60"
    4 ETQ232 RFC Login succeeded
    4 ETQ233 Calling function module "SPDA_PREPARE_PATCH" by RFC
    4 ETQ234 Call of function module "SPDA_PREPARE_PATCH" by RFC succeeded
    4 ETQ239 Logging off from SAP system
    4 ETQ010 Date & Time: 20081126150339 
    2 ETQ731 Upload failed, rc = "1", reason = "CANNOT GET FILE LIST OF
    ustcf001\patches\EPS\in"
    2 ETQ730 Starting upload of all package files in "
    ustcf001\patches\EPS\in"
    4 ETQ010 Date & Time: 20081126151823 
    4 ETQ230 Starting RFC Login to: System = "BZ3", GwHost = "ustwa356", GwService = "sapgw60"
    4 ETQ359 RFC Login to: System="BZ3", Nr="60", GwHost="ustwa356", GwService="sapgw60"
    4 ETQ232 RFC Login succeeded
    4 ETQ233 Calling function module "SPDA_PREPARE_PATCH" by RFC
    4 ETQ234 Call of function module "SPDA_PREPARE_PATCH" by RFC succeeded
    4 ETQ239 Logging off from SAP system
    4 ETQ010 Date & Time: 20081126151823 
    Hope anyone can help, thanks in advance.
    Thanks and regards
    Terry

    I tried to load the packages via SPAM, and got the following - does it mean I have corrupted EPS/in?
    Could not create file list
    Message no. PS 012
    Diagnosis
    A list of the required files could not be created as an error occurred.
    Directory:
    ustcf001\patches\EPS\in
    File mask:
    Error code: 17
    Definition of error codes:
    03 RFC system failure
    04 RFC communication failure
    11 invalid EPS subdirectory
    12 sapgparam failed
    13 build directory failed
    14 no authorization
    17 read directory failed
    18 read attributes failed
    22 too many read errors
    23 empty directory list
    System Response
    The operation was terminated.
    Procedure
    Eliminate the cause of the error and repeat the operation.

  • I cannot get Adobe ExportPDF to work. The screen is blank when I click on Select PDF files to Export.  I use windows 7.

    I cannot get Adobe ExportPDF to work. The screen is blank when I click on Select PDF files to Export.  I use windows 7. I also tried to export a document directly from Adobe Reader using the tool, but it gave me an error message. Any suggestions?

    Hi,
    Try to use different browser.
    Would it be possible for you to send me the document so that i can take a look at my end?
    You can email me at:[email protected]
    Regards,
    Florence

  • Error code -43 - unable to get file path when burning DVD

    I just installed Tiger on my son's iMac 500. Borrowed a Lacie DVD r/w and tried to burn the contents of a user folder to a DVD-R. It burned part of it, but failed with the following error:
    The operation can not be completed because one or more
    required items an not be found. (Error coed -43).
    Could not open the dat fork of "<unable to get file path>" (-43).
    I was able to burn a CD on the drive, but that was for another user directory that fit on a CD-R. The folder I was trying to burn to the DVD was about 1.1 G.
    Thanks,
    Alfredo

    I just installed Tiger on my son's iMac 500. Borrowed a Lacie DVD r/w and tried to burn the contents of a user folder to a DVD-R. It burned part of it, but failed with the following error:
    The operation can not be completed because one or more
    required items an not be found. (Error coed -43).
    Could not open the dat fork of "<unable to get file path>" (-43).
    I was able to burn a CD on the drive, but that was for another user directory that fit on a CD-R. The folder I was trying to burn to the DVD was about 1.1 G.
    Thanks,
    Alfredo

  • I cannot get my "send link" option undfer the File menu to work. Nothing happens. I went under options and set mailto to my Gmail but no luck.

    I cannot get my "send link" option under the File menu to work. Nothing happens. I went under Tools, Options, Applications and set it to my Gmail but no luck. No error messages, but the Gmail window never launches.

    Phillipp,
    I tried it again using "save link as", and this time it actually worked! I just now downloaded several more using the "save link as" option, and it works perfectly. Thanks. Problem solved.
    Littleberry

  • I AHVE DOWN LOADED YM TO MY MAC BUT CANNOT GET IT TO RUN OR PUT THE SMILEY FACE ON MY FRONT PAGE IT SAYS IT IN DOWNLOAD FILE BUT THAT ALL I GET  PLZE HELP

    I have DOWN LOADED YM TO MY MAC BUT CANNOT GET IT TO RUN OR PUT THE SMILEY FACE ON MY FRONT PAGE IT SAYS IT IN DOWNLOAD FILE BUT THAT ALL I GET  PLZE HELP.. i dwn loaded it 2x
    but icon say to slide smile face into the square i do that then all disappears
    why are thing so diffcult
    plze help
    this is yahoo messenger im talking about
    thanks
    george

    okay george, I'll try to help you
    1-download yahoo messenger. save the .dmg file to your desktop or downloads, wherever your downloaded files go. Double click on it after it has downloaded and it should open up. (ah, I see-i checked out the youtube video on how to install it). then read the terms and conditions, click on agree, then drag the app (the smiley face) to the Applications folder (the square, as you call it), then it should copy it to the Applications folder. Then right or control click on the open yahoo messenger .dmg thing, and choose Eject, which should eject it into the trash. You are done installing Yahoo Messenger. click your hard drive icon on the right top of your screen and move to the Applications folder. Yahoo Messenger should be there. If you need quick access to it, or use it a lot, you can drag a copy to the dock....
    Why are things so difficult? it's good to be curious, george. Might I suggest booking some time at the Apple store, or if you can afford to, pay for some one-to-one training
    Using the Mac isn't difficult, but it does take some practise and getting used to
    John B

  • I have tried downloading photoshop cs2 and cs4 on a new computer.  I have the disc available for cs2 and the serial number for cs4.  They are both registered in my name.  I need help doing a download.

    I have tried downloading photoshop cs2 and cs4 on a new computer.  I have the disc available for cs2 and the serial number for cs4.  They are both registered in my name.  I need help doing a download.  I was able to get part way through cs4, it showed up in my downloads but never got as far in the process as to ask for serial numbers.  I tried with cs2 and I got an error message that some bit of information was incorrect.  I currently have both downloaded on two other lap tops I own.  One is operational and one is dead.  I cannot access the dead one to remove the program. Thank you in advance for any assistance.

    For CS2 you will need to download a special new version
    CS2 Activation
    You might find CS4 download here
    Prodesign Tools — Photoshop Direct Download Links

  • Sql for extract file path without file_name form the folumn value

    Dear Experts,
    can someone give the sql script to extract file path without file_name form the folumn value.
    can someome provide sql to extract only path in the column value.
    column value :
    /data/rrsapus/oradata22/rrsa_25122011rpsp_arpch.rsp
    i need output like this */data/rrsapus/oradata22/*

    Hi,
    Welcome to the forum!
    INSTR and SUBSTR is probably the most efficient way. Use INSTR to find where the last '/' is, and SUBSTR to get that many characters, starting from the beginning of the string.
    INSTR and SUBSTR (and REGEXP_SUBSTR, and REGEXP_REPLACE, and RTRIM, and REPLACE, and all the other bullt-in functions) are documented in the SQL language manual:
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/index.htm
    REGEXP_SUBSTR or REGEXP_REPLACE would also do the job, perhaps with a little less code, but maybe not as efficiently.
    Here's a more creative way:
    SELECT     RTRIM ( str
               , REPLACE (str, '/')
               )          AS file_path
    FROM     table_x
    ;What results do you want if str does not contain a '/'?

  • HT201272 I downloaded an app 5 years ago on my iPhone with another Apple ID that I cannot get into now because I forgot the ID.  I'd like to download the same app on my iPad now.  The developer says it should be no problem.  Any ideas how to solve this?

    I downloaded an app 5 years ago on my iPhone with another Apple ID that I cannot get into now because I forgot the ID.  I'd like to download the same app on my iPad now.  The developer says it should be no problem.  Any ideas how to solve this?

    It will be tied to your old account, so only that old account will be able to re-download it - but redownloading an account's past purchases may tie a computer or device to the account for 90 days : http://support.apple.com/kb/HT4627
    Do you have a copy of it anywhere e.g. on your computer's iTunes, or on a backup of your library ? If you have it on a backup then you should be prompted to authorise the account (and I think that the id will show) if you try to add it to your computer's iTunes via File > Add To Library.

Maybe you are looking for