asaxena
Contributor
asaxena
Contributor
Activity
‎Nov 24, 2024
09:50 PM
Hi, I want to be able to set label on the document from my C++ plugin to that the same can be accessed from the jsx file. IDocument* doc = GetIDocument(...)
UIDRef ownerUID = doc->GetDocWorkSpace(); Later during the persisting command execution I have code similar to the following UIDRef owner = GetItemList()->GetRef(0);
InterfacePtr<IStringData> stringData(this, UseDefaultIID());
CHECK_BREAK(stringData);
PMString stringToWrite = stringData->Get();
InterfacePtr<I> persist(owner, UseDefaultIID());
CHECK_BREAK(persist);
persist->SetString(stringToWrite);
InterfacePtr<IScript> script(owner, UseDefaultIID());
if (script) {
PMString key = WrapperUtils<IUtilitiesWrapper>()->MakePMString(L"MyPluginLabelInfo");
script->SetTag(key, stringToWrite);
} The 'script' pointer is coming as null while it works perfectly well for Page Items such as Text. What is the correct way to assign Tags (labels?) in the above persist implementation so that the information can be accesses from the jsx script? Thanks,
... View more
‎Nov 18, 2024
06:23 AM
Ok. That helped me progress a bit (hopefully). Am I in the right direction? All the interface pointers textModel, tableModel, nesteddMCTextFrame and nesteddMCTextFrame2 are coming as null. What may I be missing? OwnedItemDataList ownedItems;
Utils<ITextUtils>()->CollectOwnedItems(pTextModel, 0, pTextModel->GetPrimaryStoryThreadSpan(), &ownedItems);
DebugClassUtilsBuffer className;
for (auto& ownedItem : ownedItems)
{
if (ownedItem.fClassID == kInlineBoss)
{
auto ownedItemUID = ownedItem.GetInlineID();
UIDRef ownedItemUIDref(pTextBoxRef.GetDataBase(), ownedItemUID);
InterfacePtr<IHierarchy> nestedMcTextFrame(ownedItemUIDref, UseDefaultIID());
CHECK_BREAK(nestedMcTextFrame);
InterfacePtr<IHierarchy> graphicFrameHierarchy(nestedMcTextFrame->QueryChild(0));
CHECK_RETURN(graphicFrameHierarchy);
auto nestedGraphicsFrameRef = ::GetUIDRef(graphicFrameHierarchy);
auto isGraphicFrame = Utils<IPageItemTypeUtils>()->IsGraphicFrame(nestedGraphicsFrameRef);
// true
InterfacePtr<IHierarchy> nestedTextFrameHierarchy(graphicFrameHierarchy->QueryChild(0));
CHECK_RETURN(nestedTextFrameHierarchy);
auto nestedTextFrameRef = ::GetUIDRef(nestedTextFrameHierarchy);
auto classIDNestedTextFrame = ::GetClass(nestedTextFrameHierarchy);
auto isTextFrame = Utils<IPageItemTypeUtils>()->IsTextFrame(nestedTextFrameHierarchy);
// true
// hopefully now I am at the nested text frame that has the table
InterfacePtr<ITextModel> textModel(nestedTextFrameHierarchy, UseDefaultIID());
// null
InterfacePtr<ITableModel> tableModel(nestedTextFrameHierarchy, UseDefaultIID());
// null
InterfacePtr<IMultiColumnTextFrame> nesteddMCTextFrame(nestedTextFrameHierarchy, UseDefaultIID());
// null
InterfacePtr<ITextFrameColumn> nesteddMCTextFrame2(nestedTextFrameHierarchy, UseDefaultIID());
// null
}
else if (ownedItem.fClassID == kTableFrameBoss)
{
////this is table
//InterfacePtr<ITableFrame> iTableFrame(db, ownedItems[i].GetInlineID(), UseDefaultIID());
//if (!iTableFrame)
// break;
//InterfacePtr<ITableModel> iTableModel(iTableFrame->QueryModel());
//if (!iTableModel)
// break;
}
} PS: Apologies, but I have very limited experience with these SDK classes and layout fundamentals.
... View more
‎Nov 18, 2024
12:06 AM
In my case, I get only 1 item in the ownedItems and that is kInlineBoss. Both isGraphicFrame and isTextFrame are false if (ownedItem.fClassID == kInlineBoss)
{
auto ownedItemUID = ownedItem.GetInlineID();
UIDRef ownedItemUIDref(pTextBoxRef.GetDataBase(), ownedItemUID);
auto isGrahicFrame = Utils<IPageItemTypeUtils>()->IsGraphicFrame(ownedItemUIDref);
auto isTextFrame = Utils<IPageItemTypeUtils>()->IsTextFrame(ownedItemUIDref);
} Can you please elaborate a bit on how to code for the below // USE - ownedItems[i].GetInlineID() and validate which boss class you get. // From there you detect if it is text frame and traverse again.
... View more
‎Nov 17, 2024
09:24 PM
Hi, I have "pasteInto" my table in to a text frame. This text frame is now "inline anchored" into another text frame. This is how it looks in the Layers window The Content hierarchy shows up like so TraceContentHierarchy() ********Begin kDocBoss, uid 0x1 Publish1146Test2-Converted.indd kSpreadBoss, uid 0xce Spread 1 content by hierarchy... kSpreadLayerBoss, uid 0xcf kPageBoss, uid 0xd3 kSpreadLayerBoss, uid 0xd0 kSpreadLayerBoss, uid 0xd1 kSplineItemBoss, uid 0x2b85 kMultiColumnItemBoss, uid 0x2b87 kFrameItemBoss, uid 0x2b99 kSpreadLayerBoss, uid 0xd2 kMasterPagesBoss, uid 0xd5 A-Parent master spread content by hierarchy... kSpreadLayerBoss, uid 0xd6 kPageBoss, uid 0xda kPageBoss, uid 0xdb kSpreadLayerBoss, uid 0xd7 kSpreadLayerBoss, uid 0xd8 kSpreadLayerBoss, uid 0xd9 TraceContentHierarchy() ********End The nested table is now accessible from script through the following code topmostTextFrame.texts[0].paragraphs[0].rectangles[0].textFrames[0].tables[0]; My question is what would be the C++ equivalent of this code. I have the UIDRef for the topmostTextFrame but I am unable to identify the boss classes that will help me get to the nested table. Here is what I have got void TraverseToNestedTableItem(const UIDRef& pPageItem)
{
InterfacePtr<IHierarchy> pageItemHierarchy(pPageItem, UseDefaultIID());
int32 nChildren = pageItemHierarchy->GetChildCount();
for (int32 child = 0; child < nChildren; ++child)
{
IDataBase* db = pPageItem.GetDataBase();
UIDRef childUIDRef(pPageItem.GetDataBase(), pageItemHierarchy->GetChildUID(child));
if (db->GetClass(childUIDRef.GetUID()) == kMultiColumnItemBoss)
{
UIDList InlineList(db);
InterfacePtr<IMultiColumnTextFrame>mcf(childUIDRef, UseDefaultIID());
if (mcf)
{
Utils<IFrameUtils>()->GetUIDListOfInlines(mcf, false, &InlineList);
int32 inlineLen = InlineList.Length();
for (int32 j = 0; j < inlineLen; ++j)
{
UIDRef inlineRef(childUIDRef.GetDataBase(), InlineList[j]);
bool16 exists = inlineRef.ExistsInDB();
auto classID = db->GetClass(InlineList[j]);
DebugClassUtilsBuffer className;
DebugClassUtils::GetIDName(&className, classID);
InterfacePtr<IHierarchy> inlineItemHierarchy(inlineRef, UseDefaultIID());
InterfacePtr<IHierarchy> inlineItem(inlineItemHierarchy->QueryChild(0));
if (inlineItem)
{
DebugClassUtilsBuffer className;
DebugClassUtils::GetIDName(&className, ::GetClass(inlineItem))
}
}
}
}
}
} Both of those diagnostics are giving me 'kSplineItemBoss'. Please suggest how to traverse to the nested table Ref: Solved: Re: Clipping a table in a textframe with pasteInto - Adobe Community - 14973447 Thanks, Edit: I realize that the content hierarchy wasn't pasted as it should have been. Here's a pic of how it shows up to show the nesting structure
... View more
‎Nov 11, 2024
10:36 PM
No, matter what I try, I land up in having the Rectangle (after pasteInto of the table) as a graphic frame inline in the Text Frame. I am using the blue marker (with Shift) to drag the Rectange as inline anchored object in the Text Frame. Please suggest what I might be missing. Thanks
... View more
‎Nov 11, 2024
09:53 PM
Ok. I tried "pasteInto" of my table into the Rectangle. The (erstwhile) Rectangle is now showing up as a <graphic frame>. How do I get this into the Rectangle as a Text Frame? By @asaxena As I said before - now, you need to Anchor / InLine this Rectangle in another TextFrame. But what exactly is your end goal? By @Robert at ID-Tasker The use case is that only some of the (potentially numerous) columns of (potentially numerous) tables need to be be visible for publication. However, at present, all the columns of the tables are being paginated by our plugin. So, we need to be able to provide a way for the user to be able to hide/clip the unrequired columns on the document for purposes of publishing
... View more
‎Nov 11, 2024
05:59 AM
Ok. I tried "pasteInto" of my table into the Rectangle. The (erstwhile) Rectangle is now showing up as a <graphic frame>. How do I get this into the Rectangle as a Text Frame?
... View more
‎Nov 11, 2024
03:48 AM
I tried those steps in InDesign and it works the exact same was the script does. I am purusing this approach based on the discussion at Solved: Re: Clipping of InDesign table - Adobe Community - 14920622 Might I have missed something?
... View more
‎Nov 11, 2024
01:36 AM
Sure. My situation is like so: I have a blue swatch table which is inside a red swatch text frame: The Layers show up like so: What I am after, is to start from the above layout, and then clip the table to the bounds of the text frame like so while retaining the blue as the table Text Frame and the Red as the Text Frame. Unfortunately the Layer window reports that the blue frame is now "graphics frame" instead of the Text Frame Thanks
... View more
‎Nov 10, 2024
10:36 PM
Hi, My use case is to be able to take a table which is inside a text frame and "pasteInto" the same text frame, so that the table clipped to the text frame dimensions. Here's the code snippets I have got so far: // Create the table var myTable = textFrame.insertionPoints[-1].tables.add(...) // Generic code to check the text frame in which the table is located var topTextFrame = undefined for (var i = 0; i < g.doc.textFrames.length; i++) { var thisTextFrame = g.doc.textFrames[i]; // Check if the text frame's story contains the nestedTextFrame as an anchored object if (thisTextFrame.textFrames.itemByID(textFrame.id).isValid) { topTextFrame = thisTextFrame; break; } } // If we located the topTextFrame, "paste Into" the table back into the same topTextFrame if (topTextFrame) { $.writeln("Top text frame found."); app.select(textFrame); app.copy(); app.select(NothingEnum.NOTHING); app.select(topTextFrame); app.pasteInto(); // At this point, the top level text frame is getting convered to a graphic frame } Q1. Is this the right way to do pasteInto for my use case? Q2. I observe on line app.pasteInto that the text frame is getting converted to a graphics frame. Is this expected and can we have a custom behavior to retain the topTextFrame as a text frame? Q3. What would be a generic code to identify the graphic frame id and the new table id (since the original myTable is already removed as part of pasteInto) Thanks,
... View more
‎Nov 08, 2024
01:13 AM
Hi,
Is there a way to temporarily suspend any startup asserts in InDesign debug on Windows (similar to macOS).
Thanks,
<Title renamed by MOD>
... View more
‎Oct 16, 2024
11:01 PM
Ok. I was able to make it work by using "Paste Into". Thanks.
... View more
‎Oct 16, 2024
05:17 AM
When I select the frame in which the table was placed, I get only "Fit Frame to Content" option. Can you please suggest the exact steps that I need to follow?
... View more
‎Oct 16, 2024
04:10 AM
Hi, I have a InDesign table that I want to be able to clip as per the yellow highlighted bounding frame. The overset indicator on the bottom is correctly clipping the table rows, but on the column it is not. Is it possible to do so in InDesign and if yes, how do I achieve it? The use case is to print only the specific parts of the table Thanks,
... View more
‎Jul 19, 2024
04:24 AM
Please suggest how to open the doc without UI (by script) In the meanwhile, I opened a new document and set the preflight to off. Then I opened the original document and InDesign crashed again.
... View more
‎Jul 17, 2024
04:24 AM
Apologies. Perhaps I wasn't very clear. My requirement is to detect the default browser and take some necessary action accordingly on the applescript. So, if the default browser is "Google Chrome" do some action, if it is "Safari" do some other custom action etc.
... View more
‎Jul 15, 2024
11:35 PM
Hi, I am trying to pass parameters from InDesign jsx to AppleScript to open up a url with some custom handling based on the user's default browser. I have this code arrangement so far: var scriptFile = new File($.fileName); // or new File(app.activeScript)
var folderPath = scriptFile.path;
var myscriptPath = folderPath + "/mycustom.scpt";
var myscriptFile = File(myscriptPath);
var myargs=["Hello "];
var myargsString=myargs.join(",");
var script = 'set scriptFile to POSIX file "' + myscriptFile.fsName + '"\n' + 'set myargs to {' + '"' + myargsString + '"' + '}\n' +
'run script scriptFile with parameters myargs';
app.doScript(script,ScriptLanguage.APPLESCRIPT_LANGUAGE); On the AppleScript side: use framework "Cocoa"
use AppleScript version "2.4"
use scripting additions
property NSURL : a reference to current application's NSURL
property NSWorkspace : a reference to current application's NSWorkspace
property NSFileManager : a reference to current application's NSFileManager
on run {myarg}
set any_url to "http://www.apple.com"
set the_url to NSURL's URLWithString:any_url
set theApp to (NSWorkspace's sharedWorkspace()'s URLForApplicationToOpenURL:the_url)
if theApp is not missing value then
-- Get the display name of the application
set appPath to theApp's |path|()
set browserName to (NSFileManager's defaultManager()'s displayNameAtPath:appPath)
display dialog (browserName as text)
else
display dialog "No application found to open the URL."
end if
end run I get this error: 1. What is the reason for this error and how to fix it? 2. Is there a better way to pass custom arguments from jsx to AppleScript and how to extract the arguments on AppleScript side? Thanks
... View more
‎Jul 11, 2024
04:13 AM
Hi,
We have a document that causes InDesign to crash while opening. This document uses our custom C++ plugin.
With the debug version of InDesign following prompts are shown before InDesign crashes
The only way to resolve the issue is to remove the PrePress plugins from InDesign
With this, after a lot of prompts, the document ultimately opens without crashing InDesign.
I do not understand the issue here and how to go about troubleshooting it.
Please advice.
Thanks
... View more
‎Jul 03, 2024
04:04 AM
It certainly looks like some run time dlls are missing. Aren't those something that the Create Cloud Desktop should be installing anyways during it's installation?
... View more
‎Jul 03, 2024
03:52 AM
Hi, While running Adobe InDesign Debug 19.4 on Windows 10, InDesign is crashing with the following alerts I have tried steps to resolve InDesign crash issues at https://helpx.adobe.com/in/indesign/kb/crash-on-launch.html?linkId=100000252567181 and https://community.adobe.com/t5/indesign-discussions/advanced-troubleshooting-for-launch-issues/m-p/11394034#M200371 but no luck. The release version of InDesign simply crashes at startup. Please suggest how to recover from this error.
... View more
‎Apr 17, 2024
02:27 AM
5 Upvotes
Hi, We are signing our InDesign extensions using the ZXPSignCmd-64bit command https://github.com/Adobe-CEP/CEP-Resources/blob/master/ZXPSignCMD/SigningTechNote_CC.pdf We have recently started using Digicert certificate and it appears the new signing requirements are as per the link EV Authenticode Signing using SignTool (digicert.com) I would like to know if there are any update to the instructions for signing InDesign extensions to align with the updated guidance from DigiCert Thanks
... View more
‎Apr 12, 2024
05:18 AM
Hi, I would prefer the C++ plugin solution but implementing in a jsx called from my plugin is also perfectly fine. Thanks
... View more
‎Apr 12, 2024
03:48 AM
Ok. Thank you. Where can I read up on this interface and the concept of "wax line"? For example, I want to understand how to set the horizontal justification of cell content to Right, Left, Center etc. I am not able to get a good starting place to understand the concepts involved. Please advice.
... View more
‎Apr 11, 2024
08:06 PM
1 Upvote
Hi, I have a requirement to find the longest line and it's length in an InDesign Table Cell and also in an InDesign table column. I am afraid but I do not know where to begin looking for getting this information. Any pointer to specific documentation or reference code will really help me. Thanks
... View more
‎Mar 26, 2024
01:39 AM
Thank you. Works like a charm!
... View more
‎Mar 26, 2024
12:23 AM
3 Upvotes
Hello, I am having the following code snippet to get the width of a specific column of a InDesign table InterfacePtr<ITableSuite> tableSuite(..); // code to select text in cell (0,2) to get the width of column 2 if (tableSuite->CanGetColumnSize()) { PMReal columnsize = tableSuite->GetColumnSize(); colWidth = ::ToDouble(columnsize); } For some reason, this is always giving me the width of column 0. Is this the right way or are there other ways of getting column width of a specific column? Thanks
... View more
‎Jan 17, 2024
02:12 AM
3 Upvotes
Hi, I want to know how to do memory leak testing for our plugins when run with release version of InDesign. I am able to do this with debug version of InDesign but "Instruments" is unable to hook into release version due to authorization issues. Please share any advice/documentation that can help me. Thanks
... View more
‎Oct 17, 2023
11:22 PM
I am also getting a whole lot of boost bind placeholder related warnings coming from InDesign SDK headers. What is the recommendation to deal with these warnings without lowering the warning level in my builds and not using the unrecommended boost predefine? external\dva\third_party\boost_libraries\boost\bind.hpp(41): message : The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.
... View more
‎Oct 16, 2023
12:53 AM
2 Upvotes
Hi, I have a bunch of warning coming from boost library which is in turned referenced from InDesign SDK. What is the recommended way of suppressing these warnings on XCode and VS? I want to suppress selective warnings only for some included files and not for the whole project without lower the warning level. Thanks
... View more