[JS] Find the layer and case-sensitive
Hello
I need to get the pageItems of a specific to InDesign with javascript layer. The problem is the name of the layer is not always the case. For example, sometimes it's 'art' or it can be 'Work', or it can be anything between the two.
I found that it works if it is all blocked:
app.activeDocument.layers.item('ARTWORK').pageItems;
I was hoping there would be something like this, but it does not work:
app.activeDocument.layers.item(/ARTWORK/i).pageItems;
Is the only way to loop through all the layers prior to find the correct character?
Thank you.
Hello
layersstring = app.activeDocument.layers.everyItem().name.join(''); getIndex = layersstring.toUpperCase().indexOf('ARTWORK'); app.activeDocument.layers.itemByName(layersstring.slice(getIndex, getIndex+7)).pageItems;
should also work.
Guess my choice would be a "normal"... loop
Hope this will work
Hans Gerd Classen
Tags: InDesign
Similar Questions
-
Shortcut/shortcut keys to switch between the layer and the layer mask?
I often see this question around and it also seems that the shortcut so that it changes from time to time. The old version, I had (CS3) had the shortcut that was I think (command + ') [this is the tilde sign] to go to the layer and (command +-) to return to the mask.
It seems, on CC, the shortcut to return to the works of mask, but it is not. No matter what work-around?
I am new to CC of CS3 so there are many things that I'm not familiar with this day. I like a lot of workflow so far. Other things, I think I have to get used to. Thank you.
I checked a site of hotkeys CS4 and I find that they have changed the hotkey after CS3 for:
(command + 2) to go to layer and (command +-) to go back to the mask. So the shortcuts for it.
-
To find the months and days between 2 dates
Hello
I want to find the months and days between 2 dates.
For example.
1 - Date: August 25, 2013
2 - Date: October 23, 2013
If we consider each month 30 days, it should give
August 25, 2013 to August 30, 2013 = 6 days
01-Sep-2013-30-Sep-2013 = 1 month
October 23, 2013 to October 30, 2013 = 8 days
Total = 1 month and 14 days.
Kindly help as soon as possible.
Thanks and greetings
Suresh
Assuming that d2 > d1,.
where d)
Select sysdate d1, sysdate + 56 double d2
Union all select to_date (March 1, 2013 ',' dd-mon-yyyy "") d1, to_date (March 31, 2013 ',' dd-mon-yyyy ') d2 double
Union all select to_date (5 February 2013 ',' dd-mon-yyyy ') d1, to_date (March 31, 2013 ',' dd-mon-yyyy "") double d2
Union all select to_date (February 25, 2013 ',' dd-mon-yyyy "") d1, to_date (March 23, 2013 ',' dd-mon-yyyy ') d2 double
Union all select to_date (February 25, 2013 ',' dd-mon-yyyy ') d1, to_date (March 31, 2013 ',' dd-mon-yyyy "") double d2
Union all select to_date (August 2, 2013 ',' dd-mon-yyyy "") d1, to_date (29 October 2013 ',' dd-mon-yyyy ') d2 double
Union all select to_date (February 1, 2013 ',' dd-mon-yyyy "") d1, to_date (May 31, 2013 ',' dd-mon-yyyy ') d2 double
Union all select to_date (25 August 2013 ',' dd-mon-yyyy "") d1, to_date ('03-Sep-2013', 'Mon-dd-yyyy') d2 double
Union all select to_date (July 30, 2013 ',' dd-mon-yyyy "") d1, to_date (August 31, 2013 ',' dd-mon-yyyy ') d2 double
Union all select to_date (July 31, 2013 ',' dd-mon-yyyy ') d1, to_date (August 30, 2013 ',' dd-mon-yyyy "") double d2
Union all select to_date (July 31, 2013 ',' dd-mon-yyyy ') d1, to_date (3 August 2013 ',' dd-mon-yyyy "") double d2
Union all select to_date (3 July 2013 ',' dd-mon-yyyy "") d1, to_date (August 31, 2013 ',' dd-mon-yyyy ') d2 double
Union all select to_date ('31-08-2013', ' dd-mm-yyyy'), to_date('05-10-2013','dd-mm-yyyy') of the double
Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('31-03-2013','dd-mm-yyyy') of the double
Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('05-03-2013','dd-mm-yyyy') of the double
Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('05-02-2013','dd-mm-yyyy') of the double
)
Select d1, d2,
1 + 30 * trunc (months_between (d2, d1)) + LESS (extract (day of d2), 30)-LESS (excerpt (d1 day), 30)
+ CASE when extracted (d2 day)< extract(day="" from="" d1)="" then="" 30="" else="" 0="" end ="">
d
D1 D2 DAYSBETWEEN
----------- ----------- -----------
October 10, 2013 5 December 2013 56
March 1, 2013 30 March 31, 2013
5 February 2013 March 31, 2013 56
February 25, 2013 March 23, 2013 29
February 25, 2013 March 31, 2013 36
August 2, 2013 29 October 2013 88
February 1, 2013 may 31, 2013 120
August 25, 2013 03 - Sep-2013 9
July 30, 2013 31 August 31, 2013
July 31, 2013 August 30, 2013 31
July 31, 2013 3 August 2013 4
July 3, 2013 August 31, 2013 58
31 August 2013 5 October 2013 36
5 February 2013 March 31, 2013 56
5 February 2013 March 5, 2013 31
February 5, 2013 February 5, 2013 1
In my view, which corresponds to your rules.
-
Toshiba 40TL938G - find the date and time settings
I have a 40TL938G and I can't find the date and time settings.
Can someone help me?SSY
I read the manual and it does ' t say anything about these settings.THX
In the settings of digital television, you should see the option called local time settings
To display the time on the TV you press the sign of the small clock on the remote control while watching a normal TV show (analog only)
-
Hello. I have two markers. It is stationary and the other is moving (app.jpg). How can I find the centers and angles shown in picture (app.jpg)?
-
How to find the utilities and windows drivers VGN-CR36G 8?
Hello
I use laptop Vaio VGN-CR36G with vista ultimate. Now, I want to install windows 8 enterprise edition.
But I can't find the drivers and utilities on the site of sony vaio.
But my product is compatible for windows 8 OS.
Here is the link below:
http://www.Sony-Asia.com/support/product/VGN-CR36G
Can someone please help me to download all drivers and software?
Thank you
Hi Whiteeasy.
This model does not support Windows 8 operating system which you can confirm from the link below.
If my post answered your question, please mark it as an "accepted Solution".
-
How to find the Maxima and Minima for each column of a 2D array?
Hello
I have a 2D chart and I would find the maxima and minima of each column of the 2-D table. Even though I know how to get maxima and minima for the whole picture but don't know how columnwise? Any ideas please?
Thank you
Rohit
Hello
@Smercurio-What you said is true, I should have shown using automatic indexing enabled which is really excellent choice. I just tried to show in a very simple way.
Anyway, here's the best way
-
How to find the maximum and minimum of a waveform between cursors
Hello!
Does anyone know an easy way to find the maximum and minimum of a waveform between two sliders?
Kind regards
Andreas
Hi Andreas,
attached, you get an example of it in MeasurementStudio.
-
Cocomputer cannot find the printer and I do not have a disk for it
Original title: printer SUPPORT
my computer cannot find the printer and I do not have a disk for it
Then, download and install the appropriate drivers on the printer manufacturer's support web site.
-
I have a U135 DX netbook with a built-in webcam. How can I find the cam and I press those keys for easier access please PS I'm not a manual.
You can get a manual here.
-
Query to find the Pages and the list of permissions associated with a particular role in PS
I want a query to find the Pages and the list of permissions associated with specific roles in PS.
For example, if we see the role of manager accounts payable, it conatins Pages and the list of permissions.
But, to get everything in EXCEL sheet by Manuel priocess's BIG job. So, can someone give me the query.
Please try under queries
The roles assigned to the list of Perm:
SELECT B.ROLENAME
OF PSCLASSDEFN A, PSROLECLASS B
WHERE (A.CLASSID = B.CLASSID
AND A.CLASSID =: 1).
List of Perm pages can access:
SELECT B.MENUNAME, B.BARNAME, B.BARITEMNAME, B.PNLITEMNAME, C.PAGEACCESSDESCR, B.DISPLAYONLY
OF PSCLASSDEFN A, PSAUTHITEM B, PSPGEACCESSDESC C
WHERE (A.CLASSID = B.CLASSID
AND A.CLASSID =: 1
AND B.BARITEMNAME > ' '
AND B.AUTHORIZEDACTIONS = C.AUTHORIZEDACTIONS)
-
Where can I find the vertical and horizontal spaces of you or margins on CC Version?.
Where can I find the vertical and horizontal spaces of you or margins on the CC Version? I need to leave a few spaces pixels around an image, but I can't find it on this new version.
Thanks in advance
In the CSS designer under window > CSS designer or SHIFT + F11
Choose the item that you are working with and press on the + in the selectors of section
Then in the Properties section, make sure that the first tab is selected (Layout) and scroll down to the margin
Set it to a number of pixels that you want (for example, 10px)
-
I posted a question can not find the question and or response. Help, please
I posted a question can not find the question and or response. Help, please
AFAIK, you can't share a catalog like this.
The only recommended method is to store your images and catalogue on an external drive, you can alternatively plug in both computers.
With today the external USB drives, the speed is still correct, and many users are satisfied with this solution.
-
Find the exhibitor and small caps
Hello
How to find the exhibitor and small caps in indesign via javascript.
Kind regards
Assia
Hi assia,.
Try this to find Exhibitor,
var doc = app.activeDocument; app.findTextPreferences = null; app.findTextPreferences.position = Position.SUPERSCRIPT; var found = doc.findText(); app.findTextPreferences = null; for(var i =0;i
for small capitals
var doc = app.activeDocument; app.findTextPreferences = null; app.findTextPreferences.capitalization = Capitalization.SMALL_CAPS; var found = doc.findText(); app.findTextPreferences = null; for(var i =0;i
Kind regards
Cognet
-
How to make CTRL + click to find the layer within a group
I searched the web, but am not finding what I need:
How the hell do you control click to select a layer in a group? Whenever I have ctrl + click on a layer in a group, it only selects the entire group. I want to find the layer I'm clicking on, not the entire group.
I don't speak from the Options bar (it's in the upper left corner)
Maybe you are looking for
-
Satellite M60-162: vertical and transparent stripe on the screen
Hello Satellite M60-162 appeared a transparent white vertical stripe on the screen of my laptop. The band is present at startup in the BIOS and in normal operation of the computer. How can I fix?
-
Qosmio F20 - 153 - update Windows XP MCE not cause to see TV tuner
Just do the following updates; Windows XP Windows tool for removing malicious software - September 2009 (KB890830) September 15, 2009Windows XP Security Update for Windows Media Format Runtime 9, 9.5 & 11 for Windows XP SP 3 (KB968816) September 15,
-
I can't import 13 000 photos in my iPhone 6 s. failed to load another one.
When I connect my iPhone 6 s to my computer, I try to import my photos. When I click on import, he said to import the 13 000 articles, but no matter whatever it is. I tried several times and it remains even at night to load but nothing happens. When
-
Update problem (Windows XP)
Automatic update of windows every day keeps updating. Even if I put it at the weekend only he keeps updating even during the week. It still have the same update content. Here is the content (in order): Office-KB980470 Windows Xp-KB977816KB978338KB979
-
Error Message hpqthb08.exe - CommonLanguageRuntime Debugging Services
I have a HP Pavilion AMD64 processor, Windows XP Home Edition 32 bit and use Firefox At startup I get first this window hpqthb08.exe CommongLanguageRuntime Debugging Services Application generated exception cannot handle (paraphrased) process ID = 0x