Restrict selection using wildcards
hie guys
I have a select statement where i need to restrict the selected items where values in a field are ZP%
SELECT * FROM marc INTO xmarc WHERE matnr IN material
and werks ne 'ZP%'.
IF sy-subrc = 0.
APPEND xmarc.
ENDIF.
ENDSELECT.
the above code is not working for me. Could anybody advise me??
regards
Prince Isaac
and werks NOT LIKE 'ZP%'.
Regards,
Rich Heilman
Similar Messages
-
Query selection filter by using wildcards
Dear all,
we have SAP BI 7 and we would like to increase usability of the end-user. We would like to use wildcard ('*') in the variable selection field of a reporting query to make the search/filter easier. Therefore, the search should support at least wildcards or even better the functionalities of R/3 (give results which are similar than to the searched word).
An example:
A report shows sales volume per customer and country. The user has to select in the variable selection the customer before the report is showing. As there are thousands of customer listed, the user should be able to use wildcards to list only relevant/wanted (e.g. 'ak*' and should get all customers containing any string like AK, ak, or other variants --> Independent if lower or upper case has been entered in the filter search).
Question:
1) How can you enable this wildcard filter function?
2) Is there any documentation/example available what can be entered and how the result is showing
Thanks for your support!!!
Edited by: Markus Reith on Jan 7, 2008 3:34 PMHello,
When u create a variable on infoobject for selection, select selection option from drop down box of details tab. Now when u execute the report it will give you a box before the input box, select * in that and the wildcard function should work. Just try it out.
Regds,
Shashank -
Using wildcards with DirectoryFile.ListFiles()
Hi all,
I need to be able to selectively grab a list of files from a directory, which
then go on to get further processed. The selection criteria is that file names
will conform to a certain template (eg. "file*.dat"). I located the method I
need in the Framework.DirectoryFile object, called ListFiles()
Here's the quandary: The ListFiles method allows two optional parameters,
prefix and suffix, which it can use to filter the resultant array of files. The
on-line help specifically states that wildcard usage is not permitted. However,
in a test run I discovered two things: (1) the prefix and suffix parameters are
severly restricting given that wildcards are not allowed, and (2) Wildcards are
apparently permitted, anyway.
To clarify, here are the results of my little test:
============================================================ ========= =====
ListFiles(prefix=NIL, suffix=NIL) [ie. full contents of directory]
Fred.txt
Test1.txt
Test2.dat
Test2.txt
ListFiles(prefix=NIL, suffix='txt')
Fred.txt
Test1.txt
Test2.txt
ListFiles(prefix='Test2', suffix=NIL)
Test2.dat
Test2.txt
ListFiles(prefix='Test', suffix='txt') [Hoping to get 'Test*.txt']
- nothing -
ListFiles(prefix='Test*', suffix='txt') [Apparently not allowed]
Test1.txt
Test2.txt
============================================================ ========= =====
This test was conducted on Windows NT and VMS, and I got the exact same results
both times.
Would anyone care to comment on why this wildcard feature apparently works
fine, but is documented as not being allowed? I am hesitant to continue
programming on the assumption that it IS allowed and DOES work, because in a
future release it may in fact be crippled in order to satisfy the documented
specification, and my cries of anguish will be greeted with the ever-comforting
"We told you so".
FYI, we are using Version 20H1, with plans to upgrade 30F2 REAL SOON.
Ideas/comments anyone?
Andrew Bird
Horizon Technologies InternationalThis is a very old thread. If you have a question you should really start your own thread for it.
In answer to your question...
UTL_FILE_DIR parameter has been deprecated since 10g.
You should no longer use the UTL_FILE_DIR parameter as it can leave security holes on your server, meaning people can access files and directories they shouldn't.
Oracle has replaced the functionality with Oracle Directories.
http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_5007.htm#SQLRF01207
Example usage:
As SYS user:
CREATE OR REPLACE DIRECTORY mydir AS 'c:\myfiles';Note: This does not create the directory on the file system. You have to do that yourself and ensure that oracle has permission to read/write to that file system directory.
Then, grant permission to the users who require access e.g....
GRANT READ,WRITE ON DIRECTORY mydir TO myuser;Then your user (myuser in this example) will use that directory object inside your FOPEN statement e.g.
fh := UTL_FILE.FOPEN('MYDIR', 'myfile.txt', 'r');Note: You MUST specify the directory object name in quotes and in UPPER case for this to work as it is a string that is referring to a database object name which will have been stored in uppercase by default. -
Hello.
I'm using WLS 5.1 with SP6 running on JDK1.2.2, platform is Windows NT
Server 4.0 SP6.
I want to know if there is a way to use wildcards to create entries for
RDBMSRealm.
The reason I want to use wildcards is that if I create an entry in the
ACLENTRIES table like this...:
A_NAME : weblogic.url
A_PRINCIPAL : testuser
A_PERMISSION : /index.html
I can restrict access for the URL http://localhost:7001/index.html to
"testuser."
However, when I create this entry, weblogic prompts for a username even if I
access a URL other than http://localhost:7001/index.html, for example,
http://localhost:7001/test.html.
When this happens, I cannot access "test.html" by using any of the usernames
that I have listed in my RDBMSRealm USERS table.
I was thinking that this works like the "weblogicURL.policy" file.
If you create one entry in the "weblogicURL.policy" file, all other URL
defaults to "everyone deny access".
I remembered that you can use wildcards in the "weblogicURL.policy" file, so
I tried changing the A_PERMISSION column to the following six patterns...:
A_PERMISSION : *
A_PERMISSION : -
A_PERMISSION : *.html
A_PERMISSION : /*
A_PERMISSION : /-
A_PERMISSION : /*.html
Using the six patterns, I tried to access http://localhost:7001/test.html
each time.
However, none of the four patterns above seemed to work, since I was
prompted and couldn't access even if I tried every username that I have in
my RDBMSRealm, in all of the six cases.
If I cannot use wildcards, this means that I would have to create entries
for every single HTML pages. (probably JSP pages, too)
Is there a way to use wildcards in the RDBMSRealm so that I can simplify
this?
Thanks ahead of time.
RYotaro.Thanks, Terry and Kishore!
I guess it's not a very smart idea to restrict access on URLs using the
RDBMSRealm...
What I was thinking was that if it was possible to put entries for Servlets,
URLs, etc... into one place, it would be easier for managers to manage
access control.
# For instance, it could cause some people confusion if access control for
URLs are listed in weblogicURL.policy and servlets are listed in RDBMSRealm.
It would be better if all of the entries are written in one place.
As a matter of fact, I have tried web-applications some time ago, and am
thinking of going back to it.
# As I recall, web-applications cannot be "hot-deployed." But there's
probably a way to get around it.
Thanks again!
Ryotaro.
"Kishore Talari" <[email protected]> wrote in message
news:[email protected]...
>
Try using a web application! Servlet spec 2.2+, WLS 510, SP6.
You can do a world of URL patterns!
The only change you will have to make is package the jsp/html,etc pagesinto a .war archive and write a web.xml file.
>
"Terry" <[email protected]> wrote:
I'm not sure that this is the way you want to go about it.
AFAICR there is no need to add aclentries in the RDBMSRealm database when
using the weblogicURL.policy file - simply add an entry to the policy
file
allowing access to all urls for all users, then add more specific entries
for those urls you wish to restrict access to. Adding stuff to the
ACLENTRIES table will not have any effect (I know because that is what I
tried first).
The documentation on wublogicURL.properties should tell you all that you
need to know
terry
Ryotaro Toda <[email protected]> wrote in message
news:[email protected]...
Hello.
I'm using WLS 5.1 with SP6 running on JDK1.2.2, platform is Windows NT
Server 4.0 SP6.
I want to know if there is a way to use wildcards to create entries for
RDBMSRealm.
The reason I want to use wildcards is that if I create an entry in the
ACLENTRIES table like this...:
A_NAME : weblogic.url
A_PRINCIPAL : testuser
A_PERMISSION : /index.html
I can restrict access for the URL http://localhost:7001/index.html to
"testuser."
However, when I create this entry, weblogic prompts for a username even
if
I
access a URL other than http://localhost:7001/index.html, for example,
http://localhost:7001/test.html.
When this happens, I cannot access "test.html" by using any of theusernames
that I have listed in my RDBMSRealm USERS table.
I was thinking that this works like the "weblogicURL.policy" file.
If you create one entry in the "weblogicURL.policy" file, all other URL
defaults to "everyone deny access".
I remembered that you can use wildcards in the "weblogicURL.policy"
file,
so
I tried changing the A_PERMISSION column to the following six
patterns...:
>>>
A_PERMISSION : *
A_PERMISSION : -
A_PERMISSION : *.html
A_PERMISSION : /*
A_PERMISSION : /-
A_PERMISSION : /*.html
Using the six patterns, I tried to accesshttp://localhost:7001/test.html
each time.
However, none of the four patterns above seemed to work, since I was
prompted and couldn't access even if I tried every username that I havein
my RDBMSRealm, in all of the six cases.
If I cannot use wildcards, this means that I would have to createentries
for every single HTML pages. (probably JSP pages, too)
Is there a way to use wildcards in the RDBMSRealm so that I cansimplify
this?
Thanks ahead of time.
RYotaro. -
I am using a logical database in HR.I use the selection screen of the logical database but i want to restrict a select options for only permit introduce one value.
I restrict in abap to only use values ,nor intervals by example and other conditions.Now i have to restrict to only one value.
it must be work like a parameterHi,
U can use No-extension to restrict multiple selcet option button.
See this link
http://www.sapdevelopment.co.uk/reporting/selscr/selscr_restrictso.htm
*: Report: ZRESTRICT_SELOPT :
*: Author: www.SAPdev.co.uk :
*: Date : 2004 :
*: Description: Demonstrates how to restrict select options to only :
*: allow specific restriction options: :
*: i.e.. EQ, NE, BT etc.. :
REPORT ZRESTRICT_SELOPT.
* Include type pool SSCR
TYPE-POOLS sscr.
TABLES: EKPO.
* Selection-screen
select-options : so_ebeln for ekpo-ebeln,
so_ebelp for ekpo-ebelp.
* Variables for populating restriction data
DATA: gd_restrict TYPE sscr_restrict. "structure containing 2 tables
DATA: gd_optlist TYPE sscr_opt_list, "header line for table 1
gd_*** TYPE sscr_***. "header line for table 2
*INITIALIZATION.
INITIALIZATION.
* Restrict SO_EBELN to only except EQ, BT and NE.
gd_optlist-name = 'KEY1'. "Can be anything
gd_optlist-options-eq = 'X'.
gd_optlist-options-bt = 'X'.
gd_optlist-options-ne = 'X'.
APPEND gd_optlist TO gd_restrict-opt_list_tab.
clear: gd_optlist.
gd_***-kind = 'S'.
gd_***-name = 'SO_EBELN'.
gd_***-sg_main = 'I'.
gd_***-sg_addy = SPACE.
gd_***-op_main = 'KEY1'. "Must be same as above
APPEND gd_*** TO gd_restrict-***_tab.
clear: gd_***.
* Restrict SO_EBELP to only except CP, GE, LT.
gd_optlist-name = 'KEY2'. "Can be anything
gd_optlist-options-cp = 'X'.
gd_optlist-options-ge = 'X'.
gd_optlist-options-lt = 'X'.
APPEND gd_optlist TO gd_restrict-opt_list_tab.
clear: gd_optlist.
gd_***-kind = 'S'.
gd_***-name = 'SO_EBELP'.
gd_***-sg_main = 'I'.
gd_***-sg_addy = SPACE.
gd_***-op_main = 'KEY2'. "Must be same as above
APPEND gd_*** TO gd_restrict-***_tab.
clear: gd_***.
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
* PROGRAM =
restriction = gd_restrict
* DB = ' '
EXCEPTIONS
TOO_LATE = 1
REPEATED = 2
SELOPT_WITHOUT_OPTIONS = 3
SELOPT_WITHOUT_SIGNS = 4
INVALID_SIGN = 5
EMPTY_OPTION_LIST = 6
INVALID_KIND = 7
REPEATED_KIND_A = 8
OTHERS = 9.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Kindly reward points for the answer which helped u and close the thread if ur problem got solved.
Message was edited by: Judith Jessie Selvi -
Restrict Select-Options for Logical Database field
The way we restrict select options for custom defined select option fields on selection screen.. can we restrict select options for standard Logical Database fields?
i.e. report uses PNPCE logical database and has field called PERNR. I want to restrict select options for this PERNR field so that it has options for 'Select single values' only.
Thanks,
Falguni
Edited by: Falguni V on Nov 13, 2010 6:42 AMYou can user AT SELECTION-SCREEN event, and check whether any record is having high value for PNPPERNR.
-
Restrict selection from LDB 'DDF' based on FI Doc number(BELNR)?
Hi all,
I am trying to restrict selection from LDB 'DDF' based on FI Doc number(BELNR).
Even if i pass only one document number in selection-screen, the program is still printing lot of documents?
Where I am going wrong?
*& Report ZSUB_READ_LDB
REPORT ZSUB_READ_LDB.
DATA wa_BSEG TYPE BSEG.
SELECT-OPTIONS s_BELNR FOR wa_BSEG-BELNR.
DATA: callback TYPE TABLE OF ldbcb,
callback_wa LIKE LINE OF callback.
DATA: seltab TYPE TABLE OF rsparams,
seltab_wa LIKE LINE OF seltab.
callback_wa-ldbnode = 'BSEG'.
callback_wa-get = 'X'.
callback_wa-get_late = 'X'.
callback_wa-cb_prog = sy-repid.
callback_wa-cb_form = 'CALLBACK_BSEG'.
APPEND callback_wa TO callback.
CLEAR callback_wa.
seltab_wa-kind = 'S'.
seltab_wa-selname = 'BELNR'.
LOOP AT s_BELNR.
MOVE-CORRESPONDING s_BELNR TO seltab_wa.
APPEND seltab_wa TO seltab.
ENDLOOP.
CALL FUNCTION 'LDB_PROCESS'
EXPORTING
ldbname = 'DDF'
variant = ' '
TABLES
callback = callback
selections = seltab
EXCEPTIONS
ldb_not_reentrant = 1
ldb_incorrect = 2
ldb_already_running = 3
ldb_error = 4
ldb_selections_error = 5
ldb_selections_not_accepted = 6
variant_not_existent = 7
variant_obsolete = 8
variant_error = 9
free_selections_error = 10
callback_no_event = 11
callback_node_duplicate = 12
OTHERS = 13.
IF sy-subrc ne 0.
WRITE: 'Exception with SY-SUBRC', sy-subrc.
ENDIF.
*& Form CALLBACK_BSEG
text
-->NAME text
-->WA text
-->EVT text
-->CHECK text
FORM CALLBACK_BSEG USING name TYPE ldbn-ldbnode
wa TYPE BSEG
evt TYPE c
check TYPE c.
CASE evt.
WHEN 'G'.
WRITE: / wa-BELNR.
ULINE.
WHEN 'L'.
ULINE.
ENDCASE.
ENDFORM. "CALLBACK_BSEGHi Andreas,
I have included bukrs and gjahr too...but if I input only one invoice number the report is printing a lot of invoices.
Not sure from where the data is being picked up?
Sorry of poor formatting of code.
Thanks ,
Subba
*& Report ZSUB_READ_LDB
REPORT ZSUB_READ_LDB.
TYPE-POOLS: RSDS, RSFS.
DATA wa_BSEG TYPE BSEG.
SELECT-OPTIONS s_BELNR FOR wa_BSEG-BELNR.
SELECT-OPTIONS s_BUKRS FOR wa_BSEG-BELNR.
SELECT-OPTIONS s_GJAHR FOR wa_BSEG-BELNR.
DATA: callback TYPE TABLE OF ldbcb,
callback_wa LIKE LINE OF callback.
DATA: seltab TYPE TABLE OF rsparams,
seltab_wa LIKE LINE OF seltab.
DATA: TEXPR TYPE RSDS_TEXPR,
FSEL TYPE RSFS_FIELDS.
start-of-selection.
callback_wa-ldbnode = 'BSEG'.
callback_wa-get = 'X'.
callback_wa-get_late = 'X'.
callback_wa-cb_prog = sy-repid.
callback_wa-cb_form = 'CALLBACK_BSEG'.
APPEND callback_wa TO callback.
CLEAR callback_wa.
seltab_wa-kind = 'S'.
seltab_wa-selname = 'BELNR'.
*seltab_wa-LOW =
LOOP AT s_BELNR.
MOVE-CORRESPONDING s_BELNR TO seltab_wa.
APPEND seltab_wa TO seltab.
ENDLOOP.
seltab_wa-kind = 'S'.
seltab_wa-selname = 'BUKRS'.
*seltab_wa-LOW =
LOOP AT s_BELNR.
MOVE-CORRESPONDING s_BUKRS TO seltab_wa.
APPEND seltab_wa TO seltab.
ENDLOOP.
seltab_wa-kind = 'S'.
seltab_wa-selname = 'GJAHR'.
*seltab_wa-LOW =
LOOP AT s_BELNR.
MOVE-CORRESPONDING s_GJAHR TO seltab_wa.
APPEND seltab_wa TO seltab.
ENDLOOP.
CALL FUNCTION 'LDB_PROCESS'
EXPORTING
ldbname = 'DDF'
variant = ' '
EXPRESSIONS = TEXPR
FIELD_SELECTION = FSEL
TABLES
callback = callback
selections = seltab
EXCEPTIONS
ldb_not_reentrant = 1
ldb_incorrect = 2
ldb_already_running = 3
ldb_error = 4
ldb_selections_error = 5
ldb_selections_not_accepted = 6
variant_not_existent = 7
variant_obsolete = 8
variant_error = 9
free_selections_error = 10
callback_no_event = 11
callback_node_duplicate = 12
OTHERS = 13.
IF sy-subrc ne 0.
WRITE: 'Exception with SY-SUBRC', sy-subrc.
ENDIF.
*& Form CALLBACK_BSEG
text
-->NAME text
-->WA text
-->EVT text
-->CHECK text
FORM CALLBACK_BSEG USING name TYPE ldbn-ldbnode
wa TYPE BSEG
evt TYPE c
check TYPE c.
CASE evt.
WHEN 'G'.
WRITE: / wa-BELNR.
ULINE.
WHEN 'L'.
ULINE.
ENDCASE.
ENDFORM. "CALLBACK_BSEG -
How to use wildcards in ABAP query where condition?
Hi,
Please tell me how to use wildcards in ABAP qurey where condition.
e.g. select * from mara where matnr = * (wildcard we need to use.
Thanks & Regards,
Gaurav TDo you want to query asterix * ?
select * from mara where matnr = '*'. "then just put it in apstrophes
or you want certain part of string be used as * ?
select * from mara where matnr like '%*' "then use % sign before it
or maybe you want something like this
select * from mara where matnr like '%1' . "then it will look for all materials having '1' inside it
Regards
Marcin -
I'm a little confused on how to use wildcards to find certain things in a sql query.
I need to pull omit certain tables from my query, and I understand how to do it by doing a 'Ma*', but am not certain how to find preceeding characters.
For instance, my column_name will be formatted like this
aaa_vw_a...
and I need to pull all of the ones that contain the vw and the vwe out of the list. I know I need the like but not sure how to format the wildcards.
Thanks for the help.echo1
Thanks for all your help.
However, when I run my query, I have noticed I'm not getting any less rows than what I was with my original query. I have put my original query below, with the two rows you have suggested, and I still get the same number for the output.
select 'select '''||column_name||
''', max(length('||column_name||')) from '||table_name||';'
from user_tab_cols
--where NOT (column_name like '___\_vw' or column_name like '___\_vwe')
--where NOT ( INSTR(table_name, 'vw') > 0 OR INSTR(table_name, 'vwe') > 0)
The INSTR seems like it might be the right idea, but then it will get things that contain vw and vwe, when I am more specifically looking for one that contains vw and vwe. Not sure what is wrong w/ my query to why it isn't eliminating anything.
Thanks for your help. -
Use wildcards in webi report filters? It seems they're only avail in Query
Can I use wildcards in webi report filters? It seems they're only avail in Queries...
HI,
Eventhough you have created variable BeX query designer.
User reponse will work ,
steps to achive,
1.open the universe build on (Bex query with customer variable)
2.you can find the filter symbol in universe for customer variable that you have created in bexx query
3. then copy the exact text eg:"select the customer" in universe for that filter
4.then in webi user reponse of that text. eg :userreponse("select the customer")
regards, -
Multiple selection with wildcard in WAD
Hello,
How can I do filtering with multiple selection with wildcard in WAD 7 ?
We have this problem in two seperate situation. The first is in the parameter screen where we want to filer the output with two wildcard. The first one we can put on the field and then go to the selection screen but what about the other ????. The second situation is in the report when we want to filter one of the columns with wildcard.
I will appreciate if someone will open my eyes about this.
IlanHello,
you can use the * for wildcards in the BEx Web.
For example 37* -> 370000 up to 379999.
Buy,
André -
Find and replace using wildcard
I've inserted table content using Insert/Table Objects/Insert Tabular Data in DWCS3 and want to remove unwanted code from the table insert.
Example:
<td width=156 valign=top style='width:117.0pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
mso-border-alt:solid windowtext .5pt;background:#FF8A50;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal><span style='mso-bookmark:CurrentPosition'><span
style='font-size:10.0pt;font-family:Arial'>
The text between "width" and "Arial'" varies but these two start and end words are the same in each instance to be replaced - how can I find and replace using a regular expression wildcard? Have researched on web but not come across answer yet. I thought it might be simple and hopefully it is and I'm just having a shocker. Is it something like Find: "<td [^"]*> and Replace with: "<td>"? Am I close?
I'd appreciate anyone's help and thankyou in advance for your time.You might be able to sort this out with Commands > Clean Up Word HTML.
However, the following regular expression should also do what you're looking for (make a backup first). Put this in the Find field:
(<td)[\w\W]+?Arial\'(>)
Put this in the Replace field:
$1$2
Select "Use regular expression". -
EJB3 QL - Selecting with wildcards and parameters
Hi,
Can you please help me create a select query which takes parameters and uses wildcards.
QL:
(List<SubjectEntity>) entityManager
.createQuery("{color:#000080}*SELECT aE FROM SubjectEntity aE WHERE aE.name like :word*{color} ")
.setParameter("word", word)
.getResultList();
I pass Corporate* to my word parameter and my TABLE has a row that contains Corporate Finance as a name and I want it matched by the parameter.
Below is an equivalent statement using SQL*
DB:
SELECT * FROM SUBJECT WHERE NAME LIKE(%?%)
Thanks.One quick fix is in the DAO method where you invoke the query, append a '%' to the end of the word before passing it to the query.
.setParameter("word", word + '%') -
How to search in Pages for any number or any character, using wildcards
Is it possible in Pages to use wildcards to search for any instance of any number? For example, I want to find all occurrences of any one or two digits followed by a colon, such as 8: or 37:
If I can't use wildcards, is there any other way to search, other than tediously searching for every instance of 1, every instance of 2, etc.?
Thanks!
SueHello
Here is an enhanced version.
--[SCRIPT highlight_ digitspluscolon]
Enregistrer le script en tant que Script : highlight_ digitspluscolon.scpt
déplacer le fichier ainsi créé dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Pages:
Il vous faudra peut-être créer le dossier Pages et peut-être même le dossier Applications.
Ouvrir un document traitement de textes Pages
aller au menu Scripts , choisir Pages puis choisir highlight_ digitspluscolon
Dans les éléments de texte, l'arrière plan des groupes de chiffres
suivis d'un caractère deux points sera mis en rouge.
--=====
L'aide du Finder explique:
L'Utilitaire AppleScript permet d'activer le Menu des scripts :
Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
Cochez la case "Afficher le menu des scripts dans la barre de menus".
--=====
Save the script as a Script: highlight_ digitspluscolon.scpt
Move the newly created file into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:
Maybe you would have to create the folder Pages and even the folder Applications by yourself.
Open a Pages word processor document.
go to the Scripts Menu, choose Pages, then choose "highlight_ digitspluscolon"
In the text objects, the background of groups of digits
with a trailing colon will be set to red.
--=====
The Finder's Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the "Show Script Menu in menu bar" checkbox.
--=====
Yvan KOENIG (VALLAURIS, France)
2010/07/17 -- enhanced to treat also text boxes and shapes
--=====
on run
local en_liste, le_dernier, un_groupe, le_premier, recul
local les_boites, une_boite, les_formes, une_forme
Try to treat the main text layer
tell application "Pages"
try
set le_document to name of document 1
tell document 1 to set le_texte to body text
on error
set le_texte to ""
end try
end tell -- Pages
if le_texte > "" then
set en_liste to my decoupe(le_texte, ":")
set le_dernier to 0
tell application "Pages" to tell document le_document
repeat with i from 1 to count of en_liste
set un_groupe to item i of en_liste
set le_dernier to le_dernier + 1 + (count of un_groupe)
set recul to 0
repeat with j from 1 to 10
if character -j of un_groupe is in "0123456789" then
set recul to -j
else
exit repeat
end if
end repeat -- with j
if recul < 0 then
set le_premier to le_dernier + recul
set character background color of characters le_premier thru le_dernier to {65535, 0, 0}
end if -- recul < 0
end repeat -- with i
end tell -- Pages…
end if -- le_texte > ""
Try to treat text boxes
try
tell application "Pages" to tell document le_document to set les_boites to every graphic whose class is text box
on error
set les_boites to {}
end try
if les_boites is not {} then
repeat with une_boite in les_boites
tell application "Pages" to tell document 1
tell une_boite to set le_texte to object text
end tell -- Pages…
my highlight(le_document, une_boite, le_texte)
end repeat
end if -- with f
Try to treat shapes
try
tell application "Pages" to tell document 1 to set les_formes to every graphic whose class is shape
on error
set les_formes to {}
end try
if les_formes is not {} then
repeat with f from 1 to count of les_formes
I know that using whose is more efficient than using an index but, in Pages '09, whose doesn't apply to shapes. *)
tell application "Pages" to tell document 1
set une_forme to item f of les_formes
tell une_forme to set le_texte to object text
end tell -- Pages
my highlight(le_document, une_forme, le_texte)
end repeat -- with f
end if
end run
--=====
on highlight(un_document, un_contenant, son_Texte)
local en_liste, le_dernier, un_groupe, recul, le_premier
set en_liste to my decoupe(son_Texte, ":")
set le_dernier to 0
tell application "Pages" to tell document un_document to tell un_contenant to tell object text
repeat with i from 1 to count of en_liste
set un_groupe to item i of en_liste
set le_dernier to le_dernier + 1 + (count of un_groupe)
set recul to 0
try (*
Useful if a shape was erroneously pasted in a text box. *)
repeat with j from 1 to 10
if character -j of un_groupe is in "0123456789" then
set recul to -j
else
exit repeat
end if
end repeat
end try
if recul < 0 then
set le_premier to le_dernier + recul
set character background color of characters le_premier thru le_dernier to {65535, 0, 0}
end if
end repeat
end tell -- Pages
end highlight
--=====
on decoupe(t, d)
local oTIDs, l
set oTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to d
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe
--=====
--[/SCRIPT]
It scans the main text layer in Word Processor documents.
It scans text boxes and shape in Word Processor and Layout documents.
Is it useful to scan :
headers, footers, tables ?
Yvan KOENIG (VALLAURIS, France) samedi 17 juillet 2010 21:07:04 -
Using wildcards (*) in sender file adapter - FTP type
Hi guys!
Dooes it work using wildcards in sender file adapter (FTP type(!) (filesystem obviously work))? I tried it and it failed. it works only for exact name..
I read some articles about FTP and the result is, that ftp work always only with 1 file, so I'm wondering, if this is possible.
Thanks for info!
OlianThanks for all replies..
I know of course, that * can be used, I use it in many scenarios too. But on a FileSystem. It is not working if the sender type is FTP.
*, ., *.dat, ... nothing like that works.. Just exact file name.
I am able to pick up file, if I specify it's exact name, so there should be no problem with permissions..
Please, I'd appreciate one reply with comfirmation: yes, we are using asterisk (*) , we access source files via FTP and they are processed.
Is there anybody with this experience, that it works?
Thank you!
Olian
Maybe you are looking for
-
Problems with After Effects/Premiere CS3 in Vista
I have read through a bundle of solutions to this problem and haven't found anything that has worked yet. I ran After Effects and Premiere Pro on Vista up until two days ago when it refused to open. When I try to open Premiere, it gives the message "
-
IN MIRO for planned delivery costs always .19 paise extra coming?
In MIRO for planned delivery costs always .19 paise extra is showing? very strage issue, kindly suggest me on the same archana
-
Issue with using Compensation handlers
HI, I have one main outer scope and 2 inner scopes. The first scope completes successfully but the second scope fails and throws a error. The error is caught in the main outer scope and I call the compensation handler for the first scope. Inside the
-
How to display html tags content in flex
hi all, It would be great if any one can lead me to a tutorial of integrating html tags content in flex. Actulay i have to insert and series to table in flex thanks
-
Hi it's 18th of September and I want to download iOS 7 on my ipad 4, but it says iOS 6.1.3 up to date help please.