Multiple selected text frame to table
I am looking for a script that will allow me to select multiple text frames at one time and have the contents in those text frames converted to tables.
What I have to do now is place the cursor in one text frame, select all, select menu item "convert to table", the defalt dialog appears and I click ok.
I have ten text frames on a page (for example). The manual process means I have to do the text to table 10 times per page.
So, I would like a script that will allow me to select all 10 text frames and convert the content of each frame to a table.
Any suggestions are appreciated.
RPP
This should do it:
if (app.documents.length > 0 && app.selection.length > 0)
for (i = 0; i < app.selection.length; i++)
try {app.selection[i].texts[0].convertToTable ("\t", "\r")}
catch (_) {}
Peter
Similar Messages
-
Bullet problem when creating text frames and tables in InDesign CS5
Every time I create a new text frame or table in InDesign CS5 and paste information there, the first row in the table or several lines of text come out with bullet points. I'm sure this is a setting or style at some point I created and now am unsure of how to delete. I would like the new text frames and tables to not include bullet points as a default when imported or pasted. Any thoughts? Thanks!
Defaults for text in the current document are made with no text selected. Turn off bullets and they should stay off (but check the styles, too, you might have accidentally set a bulleted style as the defualt and you should change the default style instead). If this is happening in all files, you need to do it with nothing open to reset the default for all new documents (existing files, unfortunately, need to be fixed one at a time).
-
How to pass multiple selected values of a table to RFC
Hi all,
My scenerio is that user selects multiple rows and click a button. i want to pass a unique id of the row to rfc.
means there are userid is unique in the table.
i want to paas the userids of all the selected rows to rfc.
Can any one help me to implement that??
regards
AnoopHi
In the context view the properties of the model node for which you have to pass the table data.
In the properties you will find a property called Structure from where you can get the structure name..in my example scenario the structre name is
Zdp_Str_Shopping_Cart
After adding all the datas to the model node, finally add that instance to the root node....
You want to pass only the selected data in the table right, for that refer the looping concept suggested by of Ayyapparaj KV
Zdp_Str_Shopping_Cart shoppingCart;
for(int i=0;i<wdContext.nodeChnIt_Shopping_Cart().size();i++)
shoppingCart = new Zdp_Str_Shopping_Cart();
shoppingCart.setEquipment_No(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getEquipment_No());
shoppingCart.setIbase(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getIbase());
shoppingCart.setKbetr(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getKbetr());
shoppingCart.setMaktx(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getMaktx());
shoppingCart.setMatnr(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getMatnr());
shoppingCart.setQuantity(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getQuantity());
shoppingCart.setSerial_No(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getSerial_No());
shoppingCart.setUnit(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getUnit());
shoppingCart.setUnit_Of_Wt(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getUnit_Of_Wt());
shoppingCart.setWaers(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getWaers());
shoppingCart.setWeight(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getWeight());
createProductOrder.addIt_Shopping_Cart(shoppingCart);
wdContext.nodeZdp_Bapi_Create_Product_Order_Input().bind(createProductOrder);
Let me know whether you got an idea and your problem get solved......
Regards
Chandran S -
How to display multiple selected rows in a table inside a popup?
Hi,
I have a table on which multiple selection is enabled. I am able to get hold of multiple selected rows i.e. i am able to iterate over the selected row keys and print their values. Now, my problem is how to display the contents of all the selected rows in a popup? I get the details of only one row when I launch the popup.
Thanks
KaranHi,
Not confident if this works or not but just try it...
1. create a ViewLink between the same view Object.
The source and destination wil be the same Vo and the source and destination attribute will be the pk of both Vos.
2. Update the changes in Appln Module.
Open the AM and in DataModel tab .
select the Same VO from which you created table in the DataModel Listbox and select the VL in the "Avaible View Objects" List Box. Add under it(selected vo in datamodel listbox).
3. Refresh DataControl accordion.
4. in your jsff page drag and drop the child vo as a table..
See if it works
Regards,
Santosh. -
Selection text frame in linked text frame remove
I chose in the text frame the linked text frames
get out of text and I want to delete a text frame
Is it possible that a command letter
same thing selecting the external canOk. Try now,
var doc = app.activeDocument;
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "~a";
var found = app.selection[0].findGrep();
for(var i =found.length-1;i>=0;i--)
var ip = found[i].insertionPoints[0];
if(found[i].allPageItems[0] instanceof TextFrame)
var cont = found[i].allPageItems[0].texts[0].duplicate(LocationOptions.AFTER,ip);
found[i].remove();
Regards,
Chinna -
Selecting text field from table ignoring capitalization
Hi,
i'm doing a read on a table using select.....where text in s_text . if i want to ignore the capitalization; how to perform the read.
for eg : if the text is saved as 'Name' and in my select criteria if i specify the selection text as 'name' it should pick up even if 'N' is not in CAPS in DB.
Thanks,
GV.Hi,
The Function Module, STRING_UPPER_LOWER_CASE will convert your string to lower case except the first letter
So if user input as name, after passing it to FM you will get the value as 'Name' and then you can able to check your condition
May this will help you
Rani -
Multiple selection of rows in table
HI,
can any one tell how to dispaly the rows selected(multiple selection) in one table can be displayed in another table in 2nd view.
Regards,
A.KHi,
1.Iterate through the node bound to the table
2 Add the selected elements to a List.
3.bind this list to a node
4.Bind this node as the datasource for the second table.
Ex:
ArrayList selectedElements = new ArrayList();
for (int x=0; x< wdContext.nodeTest().size(); x++)
if( wdContext.nodeTest().isMultiSelected(x) )
// Selected Element
IWDNodeElement nodeElement = wdContext.nodeTest().getElementAt(x);
selectedElements.add(nodeElement)
wdContext.nodeSeondNode().bind(selectedElements);
Regards
Ayyapparaj -
Can't See Text or Select Text Frame
I'm formatting a book in InDesign. On one of my two-page spreads, the text and its text frames have disappeared. I can see and select these objects in the Layers panel, so I can verify that the text frames are still there and are positioned correctly on the pages... but on the spread itself, I'm unable to see the text or click the frames to select anything. The rest of the pages in the book look fine...
This is after having right-clicked on those objects in the layers panel and choosing "Select Item(s)" ... if I were to go over now and click inside one of the text frames in the spread, it would disappear, leaving me with only the pink-purple page margin lines directly beneath the text frame's borders.
-
Optimization of an update that uses multiple selects on the same table
Oracle version : 10g
Hello,
I have created an UPDATE statement which uses two selects on a single table to do an update according to date criteria.
Due to the fact that the update has different criteria for updating according to whether the date falls within one of two ranges
(future or past) two selects were used together with a union between them to unite the results.
The end result is of course two full table scans and a poorly performing execution.
The goal is to update a field XDEL (type number) based on a date column value (column XDATE) where the dates of interest
fall both in the past (less than sysdate minus 45 days) and in the future (greater than sysdate +90 days). For records with XDATE
values within these ranges, I wish to set field XDEL=1
For records in the future (>=sysdate+90):
for a unique combination of XNAME+XCODE, where XDATE is within the date range for update, set XDEL=1
but for a non-unique combination of XNAME+XCODE+XDATE, update XDEL=1 only for the 'oldest' future record, ie update XDEL for MIN(XDATE) only
For records in the future (< sysdate+45):
for a unique combination of XNAME+XCODE, where XDATE is within the date range for update, set XDEL=1
for a non-unique combination of XNAME+XCODE, update XDEL=1 only for the 'newest' past record, ie update XDEL for MAX(XDATE) only
The combination of XNAME+XCODE XDATE is unique. As an example of the 'in the past' scenario:
XNAME | XCODE | XDATE
================
1. AAAA ~ 002 ~ 01/01/2006
2. AAAA ~ 002 ~ 02/01/2006
3. AAAA ~ 002 ~ 03/01/2006
4. XXXX ~ 123 ~ 02/01/2006
Here, we would update XDEL in record 3. as it corresponds to MAX(XDATE) for the GROUP AAA002 (and we would also update record 4. as a unique record that meets the criteria)
As an example of the 'in the future' scenario:
XNAME | XCODE | XDATE
================
1. HHHH ~ 002 ~ 01/01/2011
2. HHHH ~ 002 ~ 02/01/2011
3. HHHH ~ 002 ~ 03/01/2011
4. XXXX ~ 123 ~ 02/01/2011
Here, we would update XDEL in record 1. as it corresponds to MIN(XDATE) for the GROUP HHHH002 (and of course 4. as a unique record that meets the criteria)
Here is a query that works, but is slow:
UPDATE TAB1 SET XDEL=1 WHERE (XNAME,XCODE,XDATE) IN ((SELECT XNAME,XCODE,max(XDATE) FROM TAB1 WHERE XDATE < sysdate-45 GROUP BY XNAME,XCODE) UNION (SELECT XNAME,XCODE,min(XDATE) from TAB1 WHERE XDATE >= sysdate+90 GROUP BY XNAME,XADDR));
XDATE is a DATE type
XCODE and XADDR are VARCHAR2
XDEL is number type
Any ideas would be greatly appreciated.Here is a suggestion. The code is not tested.
update tab1 t1
set xdel = 1
where exists (select null
from (
select xname,
xcode,
max(case when xdate < sysdate-45 then xdate else null end) xdate1,
min(case when xdate >= sysdate+90 then xdate else null end) xdate2
from tab1
group by xname, xcode
) t
where t1.xname = t.xname
and t1.xcode = t.xcode
and (t1.xdate = t.xdate1 or t1.xdate = t.xdate2)) -
How to place a Xml in selected text frame?
When i set default text frame below code working fine, if i not mention the default text frame is not placing
do {
// +precondition
InterfacePtr<IDocument> document(documentUIDRef, UseDefaultIID());
ASSERT(document);
if(!document) {
break;
// -precondition
InterfacePtr<ICommand> importCmd(CmdUtils::CreateCommand(kImportXMLFileCmdBoss));
ASSERT(importCmd);
InterfacePtr<IImportXMLData> importXMLData(CreateObject2<IImportXMLData>(kImportXMLDataBoss));
ASSERT(importXMLData);
if(!importXMLData) {
break;
importXMLData->Set(documentUIDRef.GetDataBase(), contentFile, xmlReferenceWhere, kSuppressUI);
InterfacePtr<IXMLImportOptions> docXMLOptions( document->GetDocWorkSpace(), UseDefaultIID() );
ASSERT(docXMLOptions);
if(!docXMLOptions) {
break;
InterfacePtr<IXMLImportOptions> importXMLOptions(importXMLData, UseDefaultIID());
ASSERT(importXMLOptions);
if(!importXMLOptions) {
break;
importXMLOptions->Copy(docXMLOptions);
InterfacePtr<IPMUnknownData> pmUnknownData(importCmd, UseDefaultIID());
ASSERT(pmUnknownData);
if(!pmUnknownData)
break;
pmUnknownData->SetPMUnknown(importXMLData);
CmdUtils::ProcessCommand(importCmd);
ASSERT(err==kSuccess);
} while(kFalse);
I need to mention frameUIDRef to flow the text in above code.
Please suggest any soluction or idea.Hi Norio,
Itry using
InterfacePtr<ITextModel> textModel(textModelUIDRef, UseDefaultIID());
ASSERT(textModel);
if(!textModel) {
break;
// -precondition
IDataBase* database = textModelUIDRef.GetDataBase();
InterfacePtr<IIDXMLElement> rootXMLElement(Utils<IXMLUtils>()->QueryRootElement(database));
ASSERT(rootXMLElement);
if(!rootXMLElement) {
break;
XMLReference rootXMLReference = rootXMLElement->GetXMLReference();
int32 indexInParent = rootXMLElement->GetChildCount();
if(indexInParent < 0) {
indexInParent = 0;
UIDRef rootDocumentUIDRef(database,database->GetRootUID());
UIDRef tagUIDRef = this->AcquireTag(rootDocumentUIDRef, tagName);
err = Utils<IXMLElementCommands>()->CreateElement(tagUIDRef.GetUID(),
textModelUIDRef.GetUID(),
rootXMLReference,
indexInParent
its not working -
How to pass the single/multiple selected data of a table to SAP(R/3)
Hi ,
I have a table with 2 colums and 10 records.Now i want to send the selected record/Multiple records to the R/3.
Once the user checks the checkbox i retrieved the column values of that row/rows into a string array.
and i added all the string arrays to an AbstractList.
Now in function module it is giving as setT_TestOperations(AbstractList)
can any one help as how the function module understands the individual/multiple String arrays.
If possible provide sample code for the same.
Thanks and regards,
Chandrashekar.One way to achieve this is to maintain an attribute in the assistance class or a node element , called OldLeadSelection , at the Component controller level which stores the value of the lead selection index.
On LeadSelect action handler method, in the first line, read the value of the attribute/element defined above. For the first time a row is lead selected, this value will be initial. After exexcuting the code in the LeadSelection event handler method, store the LeadSelection index value in the attribute defined above. The next time when the LeadSelection event method is called, when the value of this attribute is read in the initial line, it will house the value of the index of the previous LeadSelection.
There could be other ways to achieve this. This is one of the methods.
Best Regards,
Rashmi. -
How to Insert the Text in Selected Text Frame-Reg.
Dear all,
I am using the SnipperRunner - SDK, and create the TextFrame, but I can't insert the Text in the Particular Frame. so please give me the soultions,
(*) Create TextFrame is ok,
(*) Select TextFrame is also ok,
(*) now, my Query ->
How to Insert the Text in the Selected Frame?. (or)
How to Link the Selectable Frame and my Text.? (or)
How come to know the TextFrame is select?.
Please any one can suggest me through the Coding....I will appreciate you...
Thanks & Regards,
T.R.Harihara SudhaNHi,
you have to get the TextModel associated with the textframe. Once you got that, ITextModel has an Insert()-method. You could also process kInsertTextCmdBoss - there are quite a few examples around. I believe WriteFishPrice also inserts text into a frame, just as an example. Good luck ...
Bernt -
SAP Personas - multiple selection of lines in table
Hello,
i am trying to figure out if it is possible to get/process all selected lines in SAP Personas for table with multiple line selection enabled. i found only posts where actual selected line can be identified in script - e.g. in this post: SAP Personas - dynamic selection of line from report .
I am currently working with SAP Personas 2.0, but I am interested also in Personas 3.0 functionality.
Thank you in advance,
Jan WeissensteinerIn Personas 2.0, it depends on how do you want to process the marked table entries.
Since the Personas 2.0 scripting engine doesn't support looping, you can only read the entire content of the table into an array using a JavaScript step and then evaluate this and determine which lines have been selected. Then you could process the result, for instance you could add field values from the selected rows or something like this, since it is possible to perform looping in JavaScript. However you cannot do certain actions like pressing a script button for each selected row, for instance.
In Personas 3.0, you can pretty much do anything you want since the scripting engine uses JavaScript and you can rely on JS functionality to have much more freedom, including pressing buttons. -
Select text of edited table cell
Hello,
I would like to have the text selected of a table cell i am editing. When i double click the cell, i can change the content of the cell, but i should manually select the text first.
I would like to have this text selected automatically.
Thank you in advance,
Rene BoereAdd a focus listener on the text field you are using in the cell editor. When the text field gets focus, tell it to select all of it's text. Something like this maybe:final JTextField tField = new JTextField();
tField.addFocusListener( new FocusListener() {
public void focusGained( FocusEvent fe ) {
tField.selectAll();
public void focusLost( FocusEvent fe ) { -
Pages '09: Can't use AppleScript for selected text inside tables?
When I run get selection on selected text in a Pages document, I get something like this:
<pre>text from character 1 to character 4 of body text of document id 9943974 of application "Pages"</pre>
When I run get selection on selected text inside a table cell in a table in a Pages document, I get something like this:
<pre>text from character 1 to character 4 of some table of document id 3539679 of application "Pages"</pre>
When I run get selection on selected text inside a table cell in ANOTHER table in the same Pages document, I get the exact same thing. It still says "some" table. So there is no way to distinguish between tables if there are more than one table in the same Pages document.
Am I correct in understanding that this means that most AppleScript commands for manipulating text are unusable inside table cells?
For example, it seems impossible to get the properties of the selection when the selection is selected text inside "some" table. So it's impossible do anything about text styles, etc.
Is AppleScript support in Pages ’09 really that limited, or am I missing something?The first script below should return the character style of any selection made in Pages ’09, whereas the second script should apply the "XXX" character style to any selection:
--BEGINNING OF SCRIPT 1
tell application "Pages"
activate
tell application "System Events" to tell process "Pages"
-- Show the format bar:
if not (pop up button 1 of window 1 exists) then
click menu item "Show Format Bar" of menu 1 of menu bar item "View" of menu bar 1
end if
-- Show the styles drawer and character styles:
if menu item "Show Styles Drawer" of menu 1 of menu bar item "View" of menu bar 1 exists then
keystroke "t" using {shift down, command down}
end if
tell front window
tell checkbox 1 of group 1 of drawer 1 -- “Show or hide character styles.” checkbox
repeat until it exists
delay 0.1 -- wait until the styles drawer is open
end repeat
if description is "show character style" then click
end tell
-- Get the row index (although it is not a property) of the character style:
tell menu button 2 -- “Choose a character style.” menu button
click
set k to 0
repeat
set k to k + 1
if value of attribute "AXMenuItemMarkChar" of menu item k of menu 1 exists then exit repeat
end repeat
keystroke return -- hide the menu
end tell
-- Get the character style name:
if k > 1 then set k to k + 1
value of static text 1 of row k of outline 1 of scroll area 2 of splitter group 1 of group 1 of drawer 1
end tell
end tell
end tell
--END OF SCRIPT 1
--BEGINNING OF SCRIPT 2
set myStyle to "XXX" -- the name of the character style you want to apply
tell application "Pages"
activate
tell application "System Events" to tell process "Pages"
-- Show the format bar:
if not (pop up button 1 of window 1 exists) then
click menu item "Show Format Bar" of menu 1 of menu bar item "View" of menu bar 1
end if
-- Show the styles drawer and character styles:
if menu item "Show Styles Drawer" of menu 1 of menu bar item "View" of menu bar 1 exists then
keystroke "t" using {shift down, command down}
end if
tell front window
tell checkbox 1 of group 1 of drawer 1 -- “Show or hide character styles.” checkbox
repeat until it exists
delay 0.1 -- wait until the styles drawer is open
end repeat
if description is "show character style" then click
end tell
set characterStyles to value of static text 1 of rows of outline 1 of scroll area 2 of splitter group 1 of group 1 of drawer 1
set k to 0
repeat with thisStyle in the characterStyles
set k to k + 1
if thisStyle as text is myStyle then exit repeat
end repeat
-- Apply the character style:
if k > 1 then set k to k - 1
click menu button 2 -- “Choose a character style.” menu button
click menu item k of menu 1 of menu button 2
end tell
end tell
end tell
--END OF SCRIPT 2
I suppose that +paragraph styles+ should work the same.
I'm beginning to know Pages ’09 a little better now.
Message was edited by: Pierre L. (show format bar)
Maybe you are looking for
-
Mini DisplayPort to DVI-D adapter works with Mac Mini 2010?
Hi, I would like to connect my Mac Mini (2010 edition) to both my Samsung PX2370 display and my LCD TV. Currently, I only have the Samsung display connected through the included HDMI-to-DVI adapter, but I'd like to use the HDMI output to directly con
-
Need help getting these methods to work
this program consists three seperate classes. i have two of the three working, i just can't figure out this one. here is my code, and the pseudo code for the methods. any help would be greatly appreciated. i am getting the following 18 errors Checkin
-
What can I do about my Ipod touch turning on and off by itself?
HELP.. my ipod keeps turning on and off by itself when im in the middle of using it
-
Differrence Between Process Order & Production Order
What is differrence between Process Order & Production order apart from that process order is used in process industry & other one in discrete mfg ??
-
Hello everyone, I have a problem with my Asha 302 wifi connection. Whenever I connect to my home wireless network, wifi stays connected for a few seconds and disconnects, when I trying to browse the internet, it connects again but after a few seconds