Getting the name of a new document returns an empty string.
When I try to get the name of a new document name an empty string is returned.
Why this is happening? Is it possible to get the "Untitled1.fm" I see in the application Adobe FM 2015?
It's the FDK API call that I use:
F_ApiGetString(FV_SessionId, docId, FP_Name);
Try FP_Label instead of FP_Name.
Tags: Adobe FrameMaker
Similar Questions
-
How do I get the name of Type of Document in passing a PO_HEADER_ID
Hello
Is it possible to get the TYPE_NAME of the PO_DOCUMENT_TYPES_ALL_TL for a PO_HEADER_ID?
Is there an API to get the name of Type of Document from PO_HEADER_ID?
Can someone help me with this please?
Thank you
SunnyI don't know about the API, but you can choose from PO_DOCUMENT_HEADERS_VIEW.
Sandeep Gandhi
-
How can we get the names of police of every text layer in a document?
Hi all!
I wanted to know how we can get the names of fonts applied in each text layer in a psd file. I tried the following,
NumLayers Int32 = 0;
calculate the number of text layers.
error = PIUGetInfo (classTextLayer, keyCount and numLayers, NULL);
for (int i = numLayers - 1; i > 0;--i)
{
char * fontName = new char [100];
Int32 len = 100;
get the name of the font of each layer by index.
error = PIUGetInfoByIndex (I, classTextLayer, keyFontName, fontName and len);
}
Suppose I have a document that has 2 layers of text and 2 layers of solid color as shown in the screenshot. Note that this document does not have a background layer. So, number of layers is 4.
If the layer is a layer of solid color, then I get the number of layers 0. But, if the selection of the layer is at all layers of text, I get number of layers 4. Why not get the number of layers 2 I requested info in the instruction text layers, PIUGetInfo (classTextLayer, keyCount and numLayers, NULL).
In addition, I get error =-25922 to PIUGetInfoByIndex (I, classTextLayer, keyFontName, fontName and len).
which is errReferenceNotFoundDefine.
How can I go about it?
Thank you!
Hello
I usually have "remember" United in what image is and then start working on it. This allowes me to iterate through layers when draft information or perform an action, and then set the document (in the previous state, with this wantsof user change course). Using this approach I am using index layers, but I don't know as I work on the layer is curently active layer.
Now
Getting the numbers of layer in a document:
SPErr AMAutoPlugin::GetLayNum()
{
SPErr error = kSPNoError;
numLayers Int32;
Result PIActionDescriptor = NULL;
Reference PIActionReference = NULL;
error = sPSActionReference-> Make (& reference);
If (error) goto returnError;
error is sPSActionReference-> PutEnumerated(reference,classDocument,typeOrdinal,enumTarget);.
If (error) goto returnError;
error is sPSActionControl-> Get (& result, reference);.
If (error) goto returnError;
error = sPSActionDescriptor-> GetInteger (result, keyNumberOfLayers, & numLayers);
If (error) goto returnError;
stDocData.iNumLayers=numLayers;// is just my overall
returnError:
If (result! = NULL) sPSActionDescriptor-> Free (result);
If (reference! = NULL) sPSActionReference-> Free (reference);
error return;
}
Here is a part of the code (I hope you can understand that I have cut out a lot of)
code that is not necessary in order to shorten the post) that retrieves the names of fonts.
I used this approach since I have to get a lot more detailed information about text layers (not prsented here)
I guess bu using routines from PIUGetInfoByIndex to aproprite, you can do much shorter.
SPErr AMAutoPlugin::GetTextLayerAttributes(int index, TxtLayerInfo* info)
{
In order to clarify
'info' is my structure that I filled with the data I need you can use somethong that suites you
//
UInt32 stringLength = 0;
UInt32 STRL = 0;
"" fontName char [255] = "";
"" chariot of fontStyle [255] = "";
"" char fontPSname [255] = "";
HasKey Boolean = false;
SPErr error = kSPNoError;
DescriptorTypeID runtimeKeyID;
DescriptorTypeID runtimeClassID;
DescriptorTypeID runtimeTypeID;
DescriptorTypeID runtimeUnitID;
DescriptorTypeID runtimeEnumID;
DescriptorClassID descClass;
DescriptorEnumID enumValue.
PIActionList listTextStyle = NULL;
PIActionDescriptor descLayer = NULL; / / *
PIActionDescriptor descPosition = NULL;
PIActionDescriptor descTextLayer = NULL;
PIActionDescriptor descTextStyle = NULL;
PIActionDescriptor descFont = NULL;
PIActionDescriptor descFontColor = NULL;
PIActionDescriptor descClickPoint = NULL;
PIActionDescriptor desclayerLocking = NULL;
PIActionDescriptor descEFFECTS = NULL;
error = sPSActionDescriptor-> Make (& descLayer);
If (error) goto returnError;
error = sPSActionDescriptor-> Make (& descTextLayer);
If (error) goto returnError;
error = sPSActionDescriptor-> Make (& descTextStyle);
If (error) goto returnError;
error = sPSActionList-> Make (& listTextStyle);
If (error) goto returnError;
error = sPSActionDescriptor-> Make (& descFont);
If (error) goto returnError;
error = PIUGetInfoByIndex(index,classLayer,0,&descLayer,);
If (error) goto returnError;
text
error is PIUGetSingleItemFromDescriptor (descLayer, keyText, & descTextLayer, & descClass);.
If (error) goto returnError;
//
get the police handle
error = sPSActionDescriptor-> GetList (descTextLayer, keyTextStyleRange, & listTextStyle);
If (error) goto returnError;
error = sPSActionList-> GetObject (listTextStyle, 0, & descClass, & descTextStyle);
If (error) goto returnError;
error is PIUGetSingleItemFromDescriptor (descTextStyle, keyTextStyle, & descFont, & descClass);.
If (error) goto returnError;
font size
error = sPSActionDescriptor-> GetFloat (descFont, keySizeKey, & dFontSize);
If (error) goto returnError;
Info-> dFontSize = dFontSize;
name of the font
error = sPSActionDescriptor-> GetStringLength (descFont, keyFontName, & stringLength);
If (error) goto returnError;
stringLength += 2;
error = sPSActionDescriptor-> GetString (descFont, keyFontName, fontName, stringLength);
If (error) goto returnError;
Info-> sFName = fontName;
NAME OF FONT PS
error = sPSActionControl-> StringIDToTypeID ("fontPostScriptName", & runtimeKeyID);
If (error) goto returnError;
error = sPSActionDescriptor-> GetStringLength (descFont, runtimeKeyID, &STRL);)
If (error) goto returnError;
STRL += 2;
error = sPSActionDescriptor-> GetString (descFont, runtimeKeyID, fontPSname, STRL);
If (error) goto returnError;
Info-> sPSName = fontPSname;
font name style
error = sPSActionDescriptor-> GetStringLength (descFont, keyFontStyleName, & stringLength);
If (error) goto returnError;
stringLength += 2;
error = sPSActionDescriptor-> GetString (descFont, keyFontStyleName, fontStyle, stringLength);
If (error) goto returnError;
Info-> sFStyle = fontStyle;
etc...
Hope this helps,
Kind regards
Momir
-
Is it possible to get the name of the folder that contains the current document?
Hi all!
I know how to get the name of the active document
app.activeDocument.name;
but I was wondering if you could also get the name of the folder that contains the current document. Not sure if this is possible or not, so I thought I'd ask, if so it save me a lot of time.
Thanks in advance!
Hi djbgraphicdesign,
does this work for you?
if (app.activeDocument.saved){ alert(app.activeDocument.path.name); }
Have fun
-
How do I get the name of a duplicated or created control and add a reminder
Hi all
According to the number of entry points I need, I duplicate a digital or an input string to the DuplicateCtrl function. My question is, how do I get the name and id of the control that has been created, and how can I assign a callback to it? Alternatively, it would be better to create a fresh ctrl instead of duplicate?
Thanks in advance!
Hi TurboMetrologist,
Why are you trying to get the name of constant control? Remember that you cannot use this name to address control; control names are in fact simply the macros in the file associated with the UIR, include in other words, the preprocessed compiler code and everywhere where the names of PANEL_CONTROL replaces the digital value as parameters to functions (and therefore 'control' parameter is an int value and not a char *)
That's why NewCtrl () or DuplicateCtrl () functions return a control ID: this is the handle to the new object, the only way to handle it. You will need to store this handle in a nonvolatile memory so that you can access durng life program.
In addition, there are other ways to assign a meaning to a control to pass on the name of constant control. For example, you can use the callbackData parameter to differentiate the different copies of a control.
Let me explain with an example. You said that you need several entries (dynamically created that you don't know in advance how many of them use); a solution could be:
- Design a master copy of a control in the IUR Editor, where it is easy to customize; also assign a callback function, if it must be common to all copies of the control
- Assign a value to this control callbackData, programmatically for example SetCtrlAttribute (...,..., ATTR_CALLBACK_DATA, (void *) 1);
- Duplicate the control, and then assign a different callbackData
for (i = 2; I have< 5;="" i++)="">
handle = DuplicateCtrl (...);
SetCtrlAttribute (..., handle, ATTR_CALLBACK_DATA, (void *) I);
}
By operating this way, whenever the reminder of control is triggered by any control, it will receive the callbackData assigned, and you will be able to differentiate your code with a simple switch:
switch (callbackData (int)) {}
case 1: / / the master controls
break;
case 2: / / first dual control
break;
}
-
get the name of the day of a date (format yyyy/mm/dd)
Hello
In blackberry java application development is possible to get the name of the day of a date (format yyyy/mm/dd).
I have a date as 09/15/2013. I want the output like Sunday
Thank you and best regards.
Thank you reply Erwan fo...
I post my code using... It can be used to get the name of the day for a date string.
//SimpleDateFormat write = new SimpleDateFormat("EEEE-MMM-dd");//It will return Weekday name as full plus monthe name plus date SimpleDateFormat write = new SimpleDateFormat("EEEE");//It will return Weekday name Date date = new Date(HttpDateParser.parse("2013/09/12")); System.out.println(write.format(parsedDate));
Best regards.
-
I want to get the name of Actions by javascript.
Can get the stock name to javascript?
Here is an example of creating a list of all sets/action names on the desktop.
#target photoshop var actionList = getActionSets(); var outFile = File("~/desktop/Action List.txt"); outFile.open("w"); for(var a in actionList){ outFile.writeln("Action Set " + actionList[a]); var aList = getActions(actionList[a]); for(var z in aList) { outFile.writeln(aList[z]); } } outFile.close(); outFile.execute(); function getActionSets() { cTID = function(s) { return app.charIDToTypeID(s); }; sTID = function(s) { return app.stringIDToTypeID(s); }; var i = 1; var sets = []; while (true) { var ref = new ActionReference(); ref.putIndex(cTID("ASet"), i); var desc; var lvl = $.level; $.level = 0; try { desc = executeActionGet(ref); } catch (e) { break; // all done } finally { $.level = lvl; } if (desc.hasKey(cTID("Nm "))) { var set = {}; set.index = i; set.name = desc.getString(cTID("Nm ")); set.toString = function() { return this.name; }; set.count = desc.getInteger(cTID("NmbC")); set.actions = []; for (var j = 1; j <= set.count; j++) { var ref = new ActionReference(); ref.putIndex(cTID('Actn'), j); ref.putIndex(cTID('ASet'), set.index); var adesc = executeActionGet(ref); var actName = adesc.getString(cTID('Nm ')); set.actions.push(actName); } sets.push(set); } i++; } return sets; }; function getActions(aset) { cTID = function(s) { return app.charIDToTypeID(s); }; sTID = function(s) { return app.stringIDToTypeID(s); }; var i = 1; var names = []; if (!aset) { throw "Action set must be specified"; } while (true) { var ref = new ActionReference(); ref.putIndex(cTID("ASet"), i); var desc; try { desc = executeActionGet(ref); } catch (e) { break; // all done } if (desc.hasKey(cTID("Nm "))) { var name = desc.getString(cTID("Nm ")); if (name == aset) { var count = desc.getInteger(cTID("NmbC")); var names = []; for (var j = 1; j <= count; j++) { var ref = new ActionReference(); ref.putIndex(cTID('Actn'), j); ref.putIndex(cTID('ASet'), i); var adesc = executeActionGet(ref); var actName = adesc.getString(cTID('Nm ')); names.push(actName); } break; } } i++; } return names; };
-
Get the name of the diskette of starting JS
I have an applescript script which get the name of the boot to help drive
the value macname to to name of boot disk
I wonder if the same thing can be done in a javascript that runs in InDesign CS3...
I need to make the scripts work on platforms and am new to Java script.
Thank you for all your comments...
Mydisk var = GetStartUpDisk();
Alert ("the name of my boot drive is------" "+ Mydisk +" \ "");function GetStartUpDisk() {}
If (File.fs == "Macintosh") {}
myScript var = 'tell application \"Finder\"\r.
myScript += "set myStartUpDisk to get the name of the startup Disk."
myScript += 'end tell\r;
myScript += ((parseInt (app.version.substr (0, 1) + '\"Adobe application InDesign CS to say')-2) + '") + "\"\r ";
myScript += 'say args\r script ";
myScript += ' set the value name \"myScriptArgument\ ' myStartUpDisk\r value ';
myScript += 'end tell\r;
myScript += 'end tell\r;
app.doScript (myScript, ScriptLanguage.applescriptLanguage);
var myStartUpDisk = app.scriptArgs.getValue ("myScriptArgument");
}
Else if (File.fs == "Windows") {}
var myStartUpDisk = String (Folder.system) .charAt (1);
}
Return myStartUpDisk;
} -
How to get the name of the server instance
Hi all!!
First of all, sorry if this is not the place to leave this question, but I didn't know where to post.
I have a weblogic 9.2 MP3 installed in a x 64 Redhat Linux. It is clustered in 2 cases.
An application is deployed in both cases, each request between two instances of balancing.
Of course, a request is responsed by only one instance, and I would like to know how to get the name of the instance that processes a request of some.
I read that I can send using recorded weblogic mbeans in this way:
ThenInitialContext ctx = new InitialContext(); MBeanServer mbean = (MBeanServer)ctx.lookup("java:comp/env/jmx/runtime");
And finally I iterate over the beans, but I'm not able to retrieve the name of the instance. I suppose that the object name is not appropriate.ObjectName rs = new ObjectName("com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean"); Set beans = mbean.queryNames(rs, null);
However, I am able to get the name of the server and the two names of instances per a JMX connection to service:jmx:t3://localhost:7001/jndi/weblogic.management.mbeanservers.domainruntime, but this isn't what I want because I need to know what is the instance that is a certain demand.
Anyone know how I can do?
Thank you very much and sorry for the English xD
Published by: mamntc02 on 01/05/2010 05:10That should do it...
private String getServerName() throws Exception {}
try {}
Context ctx = new world;
MBeanServer mbeanServer = (MBeanServer)ctx.lookup("java:comp/env/jmx/runtime");String runtimeServiceName = "com.bea:Name = RuntimeService, Type = weblogic.management.mbeanservers.runtime.RuntimeServiceMBean;
Create ObjectName for the runtime
RuntimeService ObjectName = new ObjectName (runtimeServiceName);Get the object for the ObjectName ServerRuntimeMBean name
ObjectName serverRuntime = mbeanServer.getAttribute (runtimeService, "ServerRuntime") (ObjectName);Get the name of the server
String serverName = (String) mbeanServer.getAttribute (serverRuntime, "Name");
If (serverName == null) return "";
otherwise return serverName;
}
catch (Exception e) {}
throw e;
}
} -
Get the name of the current stage of MainSequence in parallel sequence
Hello
I starts a sequence in parallel of the MainSequence by "use new run." This parallel sequence is constantly in querying CPU performance data for my USE and records 'on the fly' an Excel file while the MainSequence turns the test scenario.
To get a clear reference of the performance of the CPU DUT to test steps, I need to somehow get the name of the step of the test step currently performed in the MainSequence for saving it and the CPU performance data.
Is it possible to identify the current stage of the main sequence in the parallel sequence (for example, property)?
Thanks in advance,
MRet
Rette01 wrote:
Hi Doug,.
Finally, we have updated to TestStand 2013 and try to use your example.
We have some problems to get the referral of wire, which is replaced by "threadToMonitor" in the expression you have posted, as far as I understand.
The thread to monitor is the MainSequence. So, how can I get a reference to the MainSequence?
Kind regards
Rette01
Pass RunState.Thread as a parameter to the call of the sequence. The parameter must be specified as an object reference variable.
-Doug
-
interoperability c# get the name of the step
I'm trying to use a code c# module in order to be able to read the name of the step of the call. However, my code only all returns 'Step' as the name of the object (no matter what the step is actually called in the sequence). Note that I also tried to do the same thing to get the name of the calling sequence - and it always returns 'Sequence '. Where I'm going wrong? Here's the code: (see attachment for full source and example TestStand sequence in the "Debug" folder.
using System;
using System.Collections.Generic;
using System.Text;
using NationalInstruments.TestStand.Interop.API;
using System.Windows.Forms;namespace Test
{
public class TestClass
{
public void TestMethod (SequenceContext thisContext)
{
PropertyObject pObj = thisContext.AsPropertyObject ();
PropertyObject stepObj;
stepObj = pObj.Evaluate ('Step');
MessageBox.Show (stepObj.Name);
}
}
}As a bit of background, I'm trying to retrieve the name of the step of the call and the name of sequence all call them all the way to the top of the stack to the root. This same method works using the steps of the Expression, but I would like to hide the mess in a single code module. Any ideas would be appreciated!
Thank you
Phil
Hi Ray,
Thanks for the tips. Unfortunately, I think I did my a little too simplistic example! Your solution is perfect for the case of the name of the step, unfortunately, this won't work for what I'm trying to do. I write a journal of custom result which is called from the ProcessModelPostResultListEntry callback and check if 'The RecordResult' is enabled on all stages of SequenceCall in the stack and if every sequence in the stack has the option "RecordResults" is enabled. (Essentially, result record should be enabled at all levels so that the result to be connected). You may think that the recall of ProcessModelPostResultListEntry would be called only if this condition is met - unfortunately, it is only affected by the combination more nested "RecordResult" step and the properties of "RecordResults" of the sequence. Therefore, frustrating, I need to check all the way to the top of the stack to the ProcessModel. The reson why it is more complex, it is that step and sequence property further to the top of the battery are accessible by using the Evaluate() method, as opposed to the lowest level in the stack that can be accessed via thisContext.Step and thisContext.Sequence.
In any case, I worked it out in the end: in TestStand Expressions allow you to take a number of shortcuts to APIs that are not available when you use the API in a different language - so why I was able to use phrases such as:
Locals.SequenceRef = evaluate ("RunState.Caller.RunState.Caller.Sequence"),
Locals.SequenceName = SequenceRef.Name
Locals.SequenceRecResult = SequenceRef.RecordResults
whereas the similar c# code worked as expected (note that the string of RunState.Caller above is actually built dynamically depending on the depth of the call stack).
Be more explicit in c# works correctly even if:
seqObj = pObj.Evaluate ("RunState.Caller.RunState.Caller.Sequence");
SequenceName = seqObj.Evaluate ("name"). GetValString ("", 0);SequenceReqResults = seqObj.Evaluate ("RecordResults"). GetValBoolean ("", 0);
Although writing this response, I just found the following property:
SequenceContext.CallerDiscardsResults
' Returns if any order in the call stack tells TestStand to disable the results or if any step caller in the call stack instructed TestStand do not save results.
Typical! I think that this may be an easier to use way!
Thanks anyway,
Phil
-
Get the name and the data type into an object?
Hello
I would like to know if there is a way to get the names and the types of data encapsulated in an object of labview?
For example, let's say I make a simple object, called myObject to be commonplace, with private data: myObjectName (string), myObjectValue (int 32) (etc.)
So, how to build a method to return the type of the data of myObjectValue, or infact back the names and types of all data in the object field, which could be a lot?
Thank you
Paul.
-
Get the name of the caller from an application when the Crier - executing.
Hi all
Here, I'll be back with a new problem which goes as follows:
Suppose that my xyz application stores some contacts (just like in the book addresses/phone book).
Other contacts are by default stored in my Blackberry address book.
Suppose I get a call on the handset with my app xyz running in background. All I need is to retrieve the name of the caller of the xyz application and view this name as"Akash Calling... ' instead of '+ 919999999788 calling... ". "assuming that the caller details are present in the said application, his name and none of the details in the actual address book. Is it feasible. If so, please suggest.
Thanks in advance!
everything in that this is done incoming call:
1. you retrieve the number of the caller in the earpiece of the phone
2. you get the name that corresponds to this number in the background application
3. you create an entry in address book with this name and number
After callIncoming is executed, the system call screen is displayed. The phone app checks if it can find the number in the address book. It finds the number and displays the name.
After that the call is accepted or rejected remove you the address book entry.
-
Can ODI - I get the name of the file in a variable?
Hello, I am trying to get the name of the folder (or subfolder) dynamically over the package that is currently running. I tried various API (from the Toolbox) calls including < % = odiRef.getSession("SESS_NAME") % >, but this isn't quite what I need. I'm real new to ODI...
I'm under ODI 11.1.1.6
Thanks in advance.
CL
Yes, I think that this decision if more flexible. I use this way.
. or you could hold information about the records in the table or XML file or a properties file and store it in the variable... It depends on your tasks and objectives
-
get the name of the active tool and set the "BRUSHSIZE' of the Freeformpen tool
Hello all,.
Can I use the same script to swap "pentool' 'freeformPenTool' and 'vice versa' with a ' if... Else statement.
How can I get the name of the active tool?
then set the size of the tool Freeformpen: "PaintingCursors BRUSHSIZE? (ScriptingListener does not save this setting).
But I have no example on "PaintingCursors"...
then set the size of the Freeformpen too
What is that supposed to mean? A path has no width or brushsize self.
How can I get the name of the active tool?
2016, use it at your own risk.
#target photoshop
Var ref = new ActionReference();
ref.putProperty (stringIDToTypeID ("property"), stringIDToTypeID ("tool"));
ref.putEnumerated (charIDToTypeID ("capp"), charIDToTypeID ("Ordn"), charIDToTypeID ("Trgt"));
var applicationDesc = executeActionGet (ref);
Alert (typeIDToStringID (applicationDesc.getEnumerationType (stringIDToTypeID ("Tool")));
Maybe you are looking for
-
Im trying to get my site works so I could see my amd controls, I can't?
I think that my firewall may be blocking me to visit my company site so I could see my check, how can I change this without screw my computer?
-
New applications were loaded on my computer and it worked well for about 1 week. Restored, a couple of files Windows of my trash, defraged, cleaned cache, updated anti-virus deep system (no exceptions); Everything seemed to work well for a day or two
-
Not able to receive new e-mail messages in Windows Mail
Original title: my windows mail is stuck on the 21August where are new then? Does not not not the emails from ew since August 21, 2010.
-
I have a problem with some rectangular boxes that are not aligned with the background of an image. Available Adobe Muse mode itlooks perfect, in the browser, but there is a display bug.Adobe Muse Layout = OKBrowser view = error
-
License do not work on the second PC
Hello! I have 2 PC - at work and at home.I thought that a work permit well in 2 PC, but when I tried running AE or another application to the House Manager CC asks me to buy a license because the trial period is over.How can I fix it and work in my a