Setting A_UTF16Char to a file path

I'm trying to use AEGP_OpenProjectFromPath to open a manualy specificed .aep
I've tried this with error:
const A_UTF16Char *pathZ = reinterpret_cast<const A_UTF16Char *>(L"/transfer_test.aep");
suites.ProjSuite6()->AEGP_OpenProjectFromPath(pathZ, &my_projH);
After Effects error: Can't import file "var": unsupported filetype or extension. ( 0 :: 1 )
There are no examples that use AEGP_ProjSuite6's IO functions.
Any help would be great. Thanks.

Heres a start, this seems to work on OSX.  I don't know what the windows code should look like:
static void
copyConvertUTF16IntoStringLiteral(
                                  const A_UTF16Char* inputString,
                                  A_char* destination)
//is there a way to determine the length of a UTF16Char string?
int length = AEGP_MAX_PATH_SIZE;
#ifdef AE_OS_MAC
    NSString *stringNS = [NSString stringWithCharacters:inputString length:length];   
    strcpy(destination, reinterpret_cast<const A_char *>([stringNS cStringUsingEncoding:NSUTF8StringEncoding]));
    [stringNS release];
#elif defined AE_OS_WIN
    //please note, the windows code has not been tested to work.
    //TODO: add windows code
#endif
I would love to know what the windows equivalent logic should look like, but I'm not building on Windows yet, so didn't look into it.
I would also love to know how to get the size of a A_UTF16Char string.  Its hardwired to AEGP_MAX_PATH_SIZE in the example above, but that is obviously not very generic.
thanks!
-Andy

Similar Messages

  • Can't set the "print to file" path in firefox 10

    print.printer_PDF.print_to_filename
    print.printer_Print_to_File.print_to_filename
    In the previous version of Firefox those settings allowed me to print to a pdf file in a specified directory by default. In the ff10 they don't appear to have any effect? Are there new settings that replace these? Or, has this (awesome) functionality been removed for some reason?

    This is another suggestion if the bridge > preferences > file association option doesn't work. I just confirmed that the bridge method does work for me (Mac user who wants to mostly use CS5 but wants to use CS6 occasionally).
    My method that I worked out yesterday was to create a zip of the application files and then delete the originals (if you have extensions visible, they are the .app files). The logic being that if there is no application then the application can't open. Easy enough to unzip the applications when they are needed—and I confirmed taking the .apps out of cryofreeze will work.
    I know this won't work for most but it can work in a pinch - if you need to doubly ensure that you don't open and resave items in a version that doesn't work for your workflow.
    But hopefully the bridge preferences file association thing will keep working. Don't know what people do who doesn't install bridge.

  • File path applescript broken after snow leopard

    I was using this script in illustrator cs4 on a mac running 10.5 and all was good
    tell application "Adobe Illustrator"
    activate
    set theName to name of current document
    set theNamecount to count of theName
    set thePath to the file path of current document as string
    set pathCount to count of thePath
    set pathCount to (pathCount - theNamecount)
    set newPath to (text 1 thru pathCount of thePath)
    set newName to "Die for " & theName
    set finalPath to newPath & newName
    save current document in file finalPath as eps ¬
    with options ¬
    {class:EPS save options, compatibility:Illustrator 8, preview:color Macintosh, embed linked files:true, include document thumbnails:true, CMYK PostScript:true, PostScript:level 2, embed all fonts:true}
    beep 2
    activate
    end tell
    Then I upgraded to Snow Leopard now when i run the script I get this message
    error "Can’t make «data fss 9CFF84A2B8001F4F75747369646520436F7665722046696E616C2031234238413241332E61690000000064E76 706D8298F1EE9D902207CE1FFBF28E1FFBF88578F1EE9D90220» into type string." number -1700 from «data fss 9CFF84A2B8001F4F75747369646520436F7665722046696E616C2031234238413241332E61690000000064E76 706D8298F1EE9D902207CE1FFBF28E1FFBF88578F1EE9D90220» to string
    Thanks in advance.
    Rod

    G'day Rod
    Your script returns...
    error "Can’t make POSIX path of «data fss 9CFF6D0609001B33303234302D3930343537205B436F6E7665727465645D2E657073CDCC00000001616946532 3ECF0381D9748CC1D5E0A34BFFFCE70636F72650000000A033B» into type string." number -1700 from POSIX path of «data fss 9CFF6D0609001B33303234302D3930343537205B436F6E7665727465645D2E657073CDCC00000001616946532 3ECF0381D9748CC1D5E0A34BFFFCE70636F72650000000A033B» to string
    I'm running an intel iMac, so perhaps it's something to do with that.
    I'm now using this very cumbersome approach...
    on FetchFileContainer()
    tell application "Adobe Illustrator"
    set fp to do javascript "activeDocument.path"
    end tell
    set fp to my convertString(fp, "%20", " ") as text
    set newerPath to (POSIX file fp) as text
    set newerPath to newerPath as text
    if "Desktop" is in newerPath then
    set newerPath to newerPath & ":"
    repeat 3 times
    set o to offset of ":" in newerPath
    try
    set newerPath to items (o + 1) thru end of newerPath as text
    on error
    if newerPath = "Desktop:" then set newerPath to ""
    end try
    end repeat
    set ptd to path to desktop as text
    set newerPath to ptd & newerPath
    end if
    set C to newerPath
    if "desktop" is not in newerPath then
    set o to offset of ":" in newerPath
    set newerPath to items (o + 1) thru end of newerPath as text as alias
    tell application "Finder"
    try
    set C to container of (newerPath)
    end try
    end tell
    end if
    return C as text
    end FetchFileContainer
    on convertString(tString, ToFind, Tochange)
    set {oAStid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ToFind}
    set tString to text items of tString
    set AppleScript's text item delimiters to Tochange
    set tString to tString as string
    set AppleScript's text item delimiters to oAStid
    return tString
    end convertString

  • Window startplace and file path

    Hi.
    I am new to Java programming and I have a couple of questions. Hope someone will have an answer to them.
    1. When I make a program with an ordinary window, how do I start it centered on the screen?
    2. How do I make my program find picturefiles without setting up the complete file path?
    Aake J

    1. Do a search
    http://search.java.sun.com/search/java/index.jsp?qp=&nh=10&qt=%2Btitle%3Acenter+%2Btitle%3Ascreen&col=javaforums&x=19&y=7
    2. Do a search
    http://search.java.sun.com/search/java/index.jsp?qp=&nh=10&qt=%2Btitle%3Alocate+%2Btitle%3Aimages&col=javaforums

  • How to set default file path for save

    Hello all,
    I'm currently blocked on the below issue and is hoping to gain your help and insights.
    We have recently upgraded to InDesign CS6. Now when an INDD file created in an older version of INDD is opened in CS6, all the save dialogs would not default to the location of the original INDD file. Though if the same file is opened in the version of InDesign that created it, the save dialog goes to the proper location by default.
    Debugged using our custom plugin as a gate way, and found out that after InDesign CS6 performed the document upgrade/convert, the database for the converted document loses file information. i.e.  IDataBase::GetSysFile() returns nil. I think we can figure out some way to get the original file path. For example, we can intercept "kAfterOpenDocSignalResponderService", and get the original file path of the opened file from IDocumentSignalData. Though I haven't yet able to figure out a safe way to set this file path to the document, so that the save dialogs would by default point at this path.
    Utils<Facade::IWorkgroupFacade>()->InitDocumentAssetManagement(docRef, filePath) seems to do the right thing, but it seems to be quite intruding, and I'm afraid that it is overkilling and will cause bad side effect for the use case I'm looking for.
    So I'm wondering if anyone has any suggestions to achieve this without implementing/overriding the file save dialog.
    Thanks.
    -Jeff

    You should be able to avoid writing your own open-doc trap by using kDocBoss's IOpenedFileInfo to obtain the original file's path. It seems fairly reliable; the only time I've seen it come up empty is for an opened QuarkXPress document.
    I'm afraid I don't know of a sanctioned way to change IDataBase::GetSysFile() without going through the database's SaveAs machinery. Overriding this behavior might only be possible by replacing the regular Save dialog with your own.
    But if InitDocumentAssetManagement() is helping, maybe the workgroup/asset management approach is worth pursuing. Have you tried spying on that call in the debug app? You might be able to isolate and use one of the commands that it's invoking (IAMSPManager::BindAsset() / kSetAssetAttributesCmdBoss?) without all of the side-effects of the higher-level call.

  • How to set the File Path to run a javascript using Plugin Code?

    Hi All,
    Im new to Indesign Plugin Development.Can any one help me out with my problem.
    What i want to do is to run a javascript using Plugin Code.When i went through this forum i was able to find out that i should use the IscriptRunner Class to automate this.I could also figure out that the Member Function to use is "CanHandleFile" &"RunFile".
    The first parameter in CanHandleFile & RunFile Member Function is to specify the path of the JavaScript File i suppose!I could also find out that IDFile has to used to set the file path Information.
    But im clueless how to set the Javascript FilePath using IDFile.Can any one help me how to do this?Any Code Snippets Please?
    Waiting for reply.
    Thanks
    myRiaz

    Hi,  Andreas<br /><br />  Can you explain this in detail? I found it in your post before.<br /><br />  The content of elements are returned through the Characters callback function:<br /><br />From ISaxContentHandler.h:<br /><br />/**<br />        Receives character data<br /><br />The parser will call this method to report each chunk of<br />        character data. SAX parsers may return all contiguous<br />        character data in a single chunk, or they may split it into<br />        several chunks. But all characters in any single<br />        event must come from the same external entity so the<br />        Locator provides useful information.<br /><br />Note some parsers will report whitespace using the<br />        IgnorableWhitespace() method rather than this one (validating<br />        parsers must do so).<br /><br />@param Chars The characters from the XML document.<br />        */<br />virtual void Characters(const PMString& chars) = 0; <br /><br />  What i have done is implement my own SAXContentHandlerServiceBoss, and in my file XXXSAXContentHandler.cpp, I override the fonctions StartElement, EndElement, and Characters() like below: I add the PMString xmlData to collect the file content:<br /><br />class XXXSAXContentHandler : public CSAXContentHandler<br />{<br />void XXXSAXContentHandler::Characters(const WideString& chars)<br />{<br />xmlData.Append(chars);<br />}<br /><br />void XXXSAXContentHandler::StartElement(const WideString& uri, const WideString& localname, const WideString& qname, ISAXAttributes* attrs)<br />{<br />xmlData.Append("<"); xmlData.Append(localname); xmlData.Append(">");<br />}<br />void XXXSAXContentHandler::EndElement(const WideString& uri, const WideString& localname, const WideString& qname)<br />{<br />xmlData.Append("</"); xmlData.Append(localname); xmlData.Append(">");<br />}<br /><br />}<br /><br />and in my program, I use the code below to call the fonction I overrided, but I dont know how I can get the String xmlData I defined in the XXXSAXContentHandler.cpp<br /><br />InterfacePtr<IK2ServiceRegistry> serviceRegistry(gSession, UseDefaultIID());<br /><br />InterfacePtr<IK2ServiceProvider> xmlProvider(serviceRegistry->QueryServiceProviderByClassID(kXMLParserService, kXMLParserServiceBoss));<br /><br />InterfacePtr<ISAXServices> saxServices(xmlProvider, UseDefaultIID());<br />InterfacePtr<ISAXContentHandler> saxHandler(::CreateObject2<ISAXContentHandler>(kXXXSAXContentHandlerServiceBoss));<br />saxHandler->Register(saxServices);<br />bool16 parseFailed = saxServices->ParseStream(readStream, saxHandler);<br /><br />Can you give me any help?<br /><br />Thanks and regards!

  • How to set default file path while downloading alv output

    Hi,
    Can anyone tell me that how to set default file path while downloading the ALV output to system using Local file button on tool bar.
    Please look below screenshots:
    Kindly help me resolve it.
    Thanks in advance.
    Regards,
    Ashutosh Katara

    This information initial value is (maybe) stored in Windows Register (register.exe) at Software\SAP\SAPGUI Front\SAP Frontend Server\Filetransfer -> PathDownload, you can read it thru class CL_GUI_FRONTEND_SERVICES method GET_UPLOAD_DOWNLOAD_PATH and update it thru method REGISTRY_SET_VALUE. (Else there may be some parameter ID to force data, but I'm no longer sure)
    Regards,
    Raymond

  • How to set the file path dynamically based on sytem, username, and date

    Hi All,
    My requirement is upload the data into one  structure like xyz that is related to t.code MCSZ.
    file will be in  UNIx SERVER .
    PATH IS: /sapif
    file name is xy789 load .txt
    I have  to write code in one user-exit
    how can i set the file path for this.
    shall i put hard code file path?
    because i have to writecode in user-exit.
    plz tell me how to set the file path based ons syetem, username, date
    Thanks in advance
    Ram.A

    Concatenate the field SY-SYSID, SY-UNAME and SY-DATUM for the file path

  • How do I set the default file path for the Place command?

    I keep my graphics files for each document in a particular folder. Every time I open an existing InDesign document and place a new image I have to browse back to that location - even though all of the previous images in that document came from the same folder. InDesign does not remember the file path that was used previously in the document. This is very annoying.
    IS THERE A WAY TO SET THE DEFAULT FILE PATH, OR LOCATION, FOR IMAGE FILES?
    I have looked through the preferences, searched the forums and internet, but I have not found any reference to setting default paths. Is there a setting like the one in MS Word called "File Locations" on the Options toolbox?
    Thank you.

    Since you're working in ID on Windows, you can take advantage of a neat trick in Windows. Copy the file path out of the File Explorer address bar and paste it directly into the Place filename field. That will jump you directly to the desired volume. For example, let's say I want to place a graphic located at X:\PS Jobs\May PS\709672bp\Working Source Files\Links. I copy that entire path from the File Explorer address bar, go to InDesign, select File|Place, and press Control + V to paste that path into the filename field. I press the Open button and Shazam! I'm there instantly, without a bunch of navigation.
    You can do the same thing in the File|Save As and File|Export fields. Let's say you want export a PDF file from InDesign to the volume X:\PS Jobs\May PS\709672bp\Working PDF Files. First copy the desired file path from the File Explorer window. In InDesign, select File|Export, click anywhere in the filename field, and press the Home key to move the insertion point to the front of the filename. Press Control + V to paste that path in front of the filename, then add the backslash character (\). The filename will now look like this: X:\PS Jobs\May PS\709672bp\Working PDF Files\Filename.pdf. Press the Save button to bring up the Export Adobe PDF window. Select your desired PDF preset, press the Export button, and the PDF file will magically appear in the desired volume.
    This sounds really complicated, but it's not. In practice, it only takes a few seconds. I probably save an hour's worth of needless navigation every day with this technique.

  • Variable being set to file path

    Hi,
    I am having trouble getting the file path of the file I want to use in my script. This is what my code is. Basically I move a file to the desktop, but if I want to use it on another computer, I want to specific finding the file by extension only.
    set orig_file to any file of folder "Desktop" of home whose name extension is ".plist"
    I need the /Users/username/Desktop/file.plist version of the file path.
    Any help would be appreciated!
    Thanks

    Use code such as:
    tell application "Finder"
    set orig_file to POSIX path of (item 1 of (get every file of folder "Desktop" of home whose name extension is “plist") as alias)
    end tell
    (117185)

  • Set file path in report scripts

    Hi All,
    Is it possible to set the file path to save the extracted data in report scripts, if so please let me know how to do it.
    We can choose the path when executing the script in script editor but how to set the file path in the script itself.
    Thanks in Advance

    You cannot set in in the report script itself.
    But rather you can set the output file and path where the output should be extracted.
    1. When you manually run from EASS console, you can specify the path and the file name
    2. When you use Maxl to run a report script, you can specify.
    Have a look at the Export Data
    Hope it helps
    Regards
    Amarnath
    ORACLE | Essbase

  • Set the file path of get image method

    I have a program that takes multiple IV curves of some nano-devices and saves each set of the IV curve data into a CSV file. I also have a graph on the main screen that gives me a visual representation of the data after each IV curve is taken.
    My program automatically names each IV curve with a different file path and at the end of the program execution I could have 50-60 IV curves.  What i'm trying to do is have LabVIEW export an image file of the graph on my front panel and save it with the save file path as the CSV file.
    Currently i'm using "Invoke Node -> Export Image" method, which is working fine and doing exactly what I want because i can tell it what file path to save to....however it is just a black and white image.
    There is another method that I found here: http://digital.ni.com/public.nsf/allkb/5AE4ADCBB65​A6D8F86256FBF007A1AC1
    That talks about a "Invoke Node -> Get Image Method" which physically captures the colorful chart on the front panel.  However I cannot figure out a way to tell it the file path to save to.  So when I run my program, after each IV curve, it takes the image from the front panel and then on the next IV curve, it interrupts my program to ask me to overwrite the previous file because it's using the same name.
    Is there a way to tell the Get Image Method to save to a specific file path?

    Hi Puneet_K,
    Thanks for the code....I didn't know you could wire the output of the image data to a write VI.  It makes sense in theory and i thought it would work....but it's not actually writing the PNG. I even tried BMP and JPEG but no results.
    I'm posting an image of my code with the before and after.  The before uses export image and it works, the after uses the get image and it doesn't create the file.
    Attachments:
    before.PNG ‏71 KB
    after.PNG ‏71 KB

  • Set FDF file path

    Greetings,
    I have created a form that checks if fields are complete and if so, attaches a FDF file to an email.
    Here is my code:
    var f1 = this.getField("0_type").value;
    var rFields = new Array(
    ["0_type", "Form Type"],
    ["1_account_number", "Account Number"],
    ["1_name_sale_source", "Your Name and Sales Source Number"],
    ["1_pu_facility", "Pickup Facility"],
    ["1_territory", "Pickup Territory"],
    ["3_billing_name", "Billing Contact Name"],
    ["3_company_name", "Billing Company Name"],
    ["3_phone", "Billing Contact Phone"]);
    if(f1 == "re")
    function FormComplete()
    var bComplete = true;
    var errMsg = "";
    RemoveHighlights(["0_type", "1_account_number", "1_name_sale_source", "1_pu_facility", "1_territory", "3_billing_name", "3_company_name", "3_phone"]);
    for (i = 0; i < rFields.length; i++)
    if
    (this.getField(rFields[i][0]).valueAsString == " ")
    bComplete = false;
    errMsg = errMsg + rFields[i][1] + "\n";
    this.getField(rFields[i][0]).fillColor = color.red;
    if (bComplete != true)
    app.alert("The following field(s) need to be completed for a Reactivation request:\n\n" + errMsg,
    1, 1);
    return bComplete;
    function RemoveHighlights(aFields)
    console.println(aFields.length);
    for (i = 0; i < aFields.length; i++)
    this.getField(aFields[i]).fillColor = color.transparent;
    return;
    if(FormComplete())
    this.submitForm({cURL:"mailto:[email protected]?subject=Reactivation Request for "+this.getField("3_company_name").value+" #"+this.getField("1_account_number").value+"&body=Thank you for completing this form.%0A%0AReactivation requests require management approval. Once approval is granted your request will be processed.%0A%0AThank you,%0ASales Support Team&[email protected]"});
    Here's my problem:
    Users are saving the source file in different locations on their hard drives. And, some times they rename their files for future reference. When the exported FDF file arrives it is looking for that source file in the obscure location and when it doesn't find it, prompts the user to locate the file for it. We then navigate to the correct file and the FDF opens correctly.
    Here's my question:
    Using javascript, can I set a specific file path and file name that the FDF will look for when opened? In other words, if a user saves the file in some obscure place with a weird name (like XYZ), the FDF will always look for ABCD file on the desktop.
    Possible? If so, please kindly post a sample script.
    Thx,
    rob

    Not with the submitForm() method.<br /><br />You could use var myFDF = app.newFDF() then set the /F tag with myFDF.addEmbeddedFile(<path>);<br /><br />The only problem is that newFDF() is a security-restricted method so you cannot use it in document-level JavaScript, only folder-level.  If your workflow requires that you use document-level JavaScript then you will not be able to overwrite the /F tag in the FDF generated by submitForm() using any SDK methods.

  • Setting file paths

    Is there any way I can programmatically tell java.io classes to assume that file paths are within the source file directory? I'm asking because the sdk does this by default but, by running in debug directories, NetBeans changes this.

    If you get a file via Class.getResource() or Class.getResourceAsStream() it will find the file in the class path. The file can even be inside a jar file.

  • Search c:\ drive and return file path for winword.exe and save as variable

    Hi all, here is what I'm trying to do;
    1. Search C:\ drive for winword.exe
    2. take the file path and save it as a variable.
    3. Then based on the path value, use the switch statement to run "some command" 
    Essentially I'm trying to find what the file path for winword.exe is, then run a command to modify the registry.  I already have the script that will modify the registry like I want but the problem it, the path is hard coded in the script, I want to
    now look for all versions of word and set the right file path so I can make the right registry changes.

    This should get you started:
    http://ss64.com/ps/get-childitem.html
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

Maybe you are looking for