[JS] [CS4] - implementation of an if statement depending on the size of the artboard
Hello
I thought it would be relatively easy, but I can't seem to find a way to implement correctly my if/else statement. I want to say, "If the size of the artboard is equal to these coordinates (0,792,1224,0), do xyz." Here is the code that I have that doesn't seem to work. Just so that I could try to make it work I have export a JPEG image, but that's irrelevant because once I got it working I have several conditions, while if I have a document with several plans of work, I can say different work plans to do different things, based on size. Any help is greatly appreciated. Let me know if osmething makes no sense.
var doc = app.activeDocument; if(doc.artboards[0.artboardRect == [0,792,1224,0]){ var destJPG = new File ("D:/Checkout/" + doc.name.split(".ai")[0] + ".jpg"); var exportOptions = new ExportOptionsJPEG(); var type = ExportType.JPEG; exportOptions.artBoardClipping = true; exportOptions.qualitySetting = 100; doc.exportFile(destJPG, type, exportOptions); }
you're almost there
replace
if(doc.artboards[0.artboardRect == [0,792,1224,0]){
with
if(doc.artboards[0].artboardRect == "0,792,1224,0"){
Tags: Illustrator
Similar Questions
-
Hi guys, am hoping someone can help with this query.
I have 2 tables
Search
----------
code VC2 (10)
Description VC2 (50)
domain VC2 (50)
MyTab
----------
hour date
VC2 status (10)
The data should be like this:
Search
----------
B, buy, Transaction
S, sale, Transaction
R, back, Transaction
O, old, to Condition
N, new, Condition
MyTab
---------
JANUARY 1, 2008, B
JANUARY 1, 2008, B
JANUARY 1, 2008, B
JANUARY 1, 2008, S
JANUARY 1, 2008, S
JANUARY 1, 2008, R
JANUARY 2, 2008, B
JANUARY 2, 2008, B
JANUARY 2, 2008, R
JANUARY 3, 2008, B
JANUARY 3, 2008, S
What I want to do, is go back a number of lines for each date in mytab, for each possible transaction situation, even if it's 0.
If the query returns
hour, status, County
----------------------------------
JANUARY 1, 2008, B, 3
JANUARY 1, 2008, S, 2
JANUARY 1, 2008, R, 1
JANUARY 2, 2008, B, 2
JANUARY 2, 2008, S, 0
JANUARY 2, 2008, R, 1
JANUARY 3, 2008, B, 1
JANUARY 3, 2008, S, 1
JANUARY 3, 2008, R, 0
So because there are 3 rows of transaction status in the lookup table, you always get 3 rows returned BY DATE in the table mytab.
Is it possible without using loads of trade unions?
Thank you!
Scott
Published by: Scott Hillier on November 5, 2008 15:24Nicolas-
I don't think that you need a self-join.
(my apologies for the bad formatting, cannot understand the syntax of the citation!)
with
list of choices like
(select code 'B', 'Buy' descr, area of "Transaction" of union double all the)
Select' code, descr 'Sell', 'Transaction' of all field double union
Select code 'R', 'Return' descr, area of 'Deal' of all the double union
Select ' o ' code, descr 'Old', 'Condition' field of dual union all
Select "n" code, descr 'New', 'Condition' field of the double),
MyTab as
(select to_date (January 1, 2008 "," MON-DD-YYYY "") transdate, status 'B' of all the double union)
Select to_date (January 1, 2008 "," MON-DD-YYYY "") transdate, status 'B' of all the double union
Select to_date (January 1, 2008 "," MON-DD-YYYY "") transdate, status 'B' of all the double union
Select to_date (January 1, 2008 "," MON-DD-YYYY "") transdate, the from ' Union status double all the
Select to_date (January 1, 2008 "," MON-DD-YYYY "") transdate, the from ' Union status double all the
Select to_date (January 1, 2008 "," MON-DD-YYYY "") hour, status of 'R' of all the double union
Select to_date (January 2, 2008 "," MON-DD-YYYY "") transdate, status 'B' of all the double union
Select to_date (January 2, 2008 "," MON-DD-YYYY "") transdate, status 'B' of all the double union
Select to_date (January 2, 2008 "," MON-DD-YYYY "") hour, status of 'R' of all the double union
Select to_date (January 3, 2008 "," MON-DD-YYYY "") transdate, status 'B' of all the double union
Select to_date (January 3, 2008 "," MON-DD-YYYY "") transdate, the from ' double status)
Select trunc (a.transdate), c.code, count (decode(a.status,c.code,1))
mytab a.,
Search c
where c.domain (+) = "Transaction".
Trunc Group (a.transdate), c.code
order of trunc (a.transdate);TRUNC (A.TRANSDATE) CODE COUNT (DECODE(A.STATUS,C.CODE,1))
------------------------- ---- --------------------------------
1 JANUARY 08 B 3
1 JANUARY 08 R 1
1 JANUARY 08 S 2
JANUARY 2 08 B 2
JANUARY 2 08 S 0
JANUARY 2 08 R 1
JANUARY 3 08 B 1
JANUARY 3 08 R 0
JANUARY 3 08 S 19 selected lines
-
Hello
I'm looking how to implement LOV dependent within a table.
I have two columns inside the so-called A, B.
I have a value in a (text style) and then B (LOV). After mark I will be showing the values in the table so A is completed by research and B will take A value of show the dependent values of the a.
Hope I'm clear with the tip.
Concerning
RAM
This can be achieved by using the following steps.
To make the second LOV to be dependent by the first style of message text.
Create a form value in the same region and make the viewobject definition is the same as the message text style (MST).
now, use the VALUE of the criteria for the lovmap element in the ENTRANCE of the LOV.
as the value of the form is in the region it will choose the value whenever the LOV is interviewed and helps in implementing this feature.
-
A statement UPDATE changes the line if the update changes the column even value?
HI -.
I have a main classification and the corresponding audit table. I have a trigger. I created using the suggestion:http://www.runningoracle.com/product_info.php?products_id=211
Now the problem that I am facing is that: if I run the same query (same value) update on the main table for n times (with the same data)... my audit table is updated with a new record every time. He is not able to determine that the value is the same.
My goal is to load the audit table data if the value in a cell in the main table is really have changed.
A statement UPDATE changes the line if the update changes the column even value?
Best regards
I have a main Table and the corresponding Audit Table. I have a trigger. I created using the suggestion:http://www.runningoracle.com/product_info.php?products_id=211
Why?
You try to resolve what made you what are the PROBLEM that select as the solution?
Now the problem that I am facing is that: if I run the same query (same value) update on the main table for n times (with the same data)... my audit table is updated with a new record every time.
Yes - it is EXACTLY what you say that you wanted to do and EXACTLY what the code does in this article.
He is not able to determine that the value is the same.
I think you mean that the code does NOT check if the value is the same. You can certainly change the code to do this check. But I have a question to start with your need for such a solution.
My goal is to load the audit table data if the value in a cell in the main table is really have changed.
OK - then modify the code to check EACH COLUMN and compare its NEW value to the OLD value and insert only the table of audit if SOME (or columns you care specifically) have changed.
A statement UPDATE changes the line if the update changes the column even value?
It depends on what you mean by 'change the line '. Of course to update a column with the SAME value does not change the resulting data value.
But the physical structure of the line, the location of the pieces of line and information in the header block (YVERT, etc.) will change. And, as others have said Oracle doesn't know and doesn't care, so if the new value of a column is the same as the old value will create redo, undo and the rest.
Start over and tell us what PROBLEM you're trying to solve. Then we can help you find the best way to solve it.
-
Disabled-Adobe Acrobat 9 Pro on old PC. Implementation error when you try to install the new PC. "Invalid serial number."
Please see the following documents.
Let us know if that helps.
-
Folders faster back online rather than with or depends on the situation
Hello
I have used with many requests for better readability. This latest request seems to take a little more time to run and
I don't think much up to what a colleague showed me their version (completely different sql statement), which ran faster, but seemed
more complicated and had more lines of code. I noticed that the other version has not used with. I moved the sql code of the with in
the join and the query ran a faster drop from 30 seconds to 798 ms. The question is I am sacrificing speed for better readability of
using with or it really depends on the overall sql statement.
Here is the query using WITH:
Inline version:with prev as ( select person_uid, id, name, academic_period, case when enrolled_ind = 'Y' and registered_ind = 'N' and student_status = 'AS' then 0 else 1 end as enreg_stat, row_number () over (partition by person_uid order by academic_period desc) as rn, student_status from academic_study ac where substr(academic_period,-1) = '0' and case when enrolled_ind = 'Y' and registered_ind = 'N' and student_status = 'AS' then 0 else 1 end = 1 ) select aa.person_uid, aa.id, aa.name, aa.academic_period, aa.latest_decision, aa.college, aa.program, prev.academic_period as prevterm, prev.student_status, ad.aid_year, sum(ad.total_paid_amount) as Amount_Disbursed, sysdate as date_updated from admissions_application aa left outer join award_by_aid_year ad on aa.person_uid = ad.person_uid and aa.aid_year = ad.aid_year left outer join prev on aa.person_uid = prev.person_uid where substr(aa.academic_period,-1) = '5' and aa.academic_period between &TERMSTART and &TERMEND and (aa.appl_accept_any_time_ind = 'Y' or aa.inst_admit_any_time_ind = 'Y') and prev.rn = 1 group by aa.person_uid, aa.id, aa.name, aa.academic_period, aa.latest_decision, aa.college, aa.program, prev.academic_period, prev.student_status, ad.aid_year
select aa.person_uid, aa.id, aa.name, aa.academic_period, aa.latest_decision, aa.college, aa.program, prev.academic_period as prevterm, prev.student_status, ad.aid_year, sum(ad.total_paid_amount) as Amount_Disbursed, sysdate as date_updated from admissions_application aa left outer join award_by_aid_year ad on aa.person_uid = ad.person_uid and aa.aid_year = ad.aid_year left outer join ( select person_uid, id, name, academic_period, case when enrolled_ind = 'Y' and registered_ind = 'N' and student_status = 'AS' then 0 else 1 end as enreg_stat, row_number () over (partition by person_uid order by academic_period desc) as rn, student_status from academic_study ac where substr(academic_period,-1) = '0' and case when enrolled_ind = 'Y' and registered_ind = 'N' and student_status = 'AS' then 0 else 1 end = 1 ) prev on aa.person_uid = prev.person_uid where substr(aa.academic_period,-1) = '5' and aa.academic_period between &TERMSTART and &TERMEND and (aa.appl_accept_any_time_ind = 'Y' or aa.inst_admit_any_time_ind = 'Y') and prev.rn = 1 group by aa.person_uid, aa.id, aa.name, aa.academic_period, aa.latest_decision, aa.college, aa.program, prev.academic_period, prev.student_status, ad.aid_year
user1069723 wrote:
I moved the sql code of the with in
the join and the query ran a faster drop from 30 seconds to 798 ms. The question is I am sacrificing speed for better readability of
using with or it really depends on the overall sql statement.It can happen - I wrote about this a couple of years (http://jonathanlewis.wordpress.com/2010/06/29/subquery-factoring-3/), but don't think it would still be a problem with 11.2; However, you use ANSI and the transformations made by Oracle to manage ANSI combined could have caused the missing cycle of transformations (or find) a strategy that made the difference (transformation quirks with ANSI have quite frequently on the forum). Technically, it seems as if the weighted subquery must have been moved, inline - but maybe it wasn't, or maybe it was but after that ANSI transformation had taken place, leading to the optimizer missing a secondary processing. Until we see the plan of execution, we can not say more than that.
Update: here is another example of the problem that might be relevant, given your outer join: http://jonathanlewis.wordpress.com/2010/09/13/subquery-factoring-4/
Concerning
Jonathan LewisPublished by: Jonathan Lewis January 16, 2013 21:43
Add second example -
calculate the balance depends on the previous record result
Hello
I have a requirement like calculating the balance depends on the previous record result. but I'm unable to accomplish by using select statement.
Sample data: WITH T AS (SELECT 10 AMOUNT, 0.2 PERCENT FROM DUAL UNION ALL SELECT 11 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 12 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 13 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 14 AMOUNT, 0.3 PERCENT FROM DUAL )
process: 10(AMOUNT) * 0.2(PERCENT) = 2 11 - 2(Result of previous calculation) = 9 12 - 9(Result of previous calculation) = 3 13 -3(Result of previous calculation) = 10 14 - 10(Result of previous calculation) = 4;
Please, help me build the select statement.required output. AMOUNT RESULT 10 2 11 9 12 3 13 10 14 4
There is no order in the lines of the relational table. Only ORDER BY guarantees the order. So, even if the AMOUNT is increasing in your sample, I guess in life real amounts are in no particular order. If Yes, you need another column indicating the order of the lines:
WITH T AS ( SELECT 1 ID, 10 AMOUNT, 0.2 PERCENT FROM DUAL UNION ALL SELECT 2 ID, 11 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 3 ID, 12 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 4 ID, 13 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 5 ID, 14 AMOUNT, 0.3 PERCENT FROM DUAL ) SELECT AMOUNT, RESULT FROM T MODEL DIMENSION BY(ID) MEASURES(AMOUNT,AMOUNT RESULT,PERCENT) RULES( RESULT[1] = RESULT[1] * PERCENT[1], RESULT[ID > 1] ORDER BY ID = RESULT[CV()] - RESULT[CV() - 1] ) ORDER BY ID / AMOUNT RESULT ---------- ---------- 10 2 11 9 12 3 13 10 14 4 SQL>
If the AMOUNT is still growing:
WITH T AS ( SELECT 10 AMOUNT, 0.2 PERCENT FROM DUAL UNION ALL SELECT 11 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 12 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 13 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 14 AMOUNT, 0.3 PERCENT FROM DUAL ) SELECT AMOUNT, RESULT FROM T MODEL DIMENSION BY(ROW_NUMBER() OVER(ORDER BY AMOUNT) ID) MEASURES(AMOUNT,AMOUNT RESULT,PERCENT) RULES( RESULT[1] = RESULT[1] * PERCENT[1], RESULT[ID > 1] ORDER BY ID = RESULT[CV()] - RESULT[CV() - 1] ) ORDER BY ID / AMOUNT RESULT ---------- ---------- 10 2 11 9 12 3 13 10 14 4 SQL>
SY.
-
How to dynamically change the image depend on the input parameter
Hi all
I have a running report depend on the particular organization, I have 15 operating unit and 15 different logo for each operating unit.
How to change the Logo depend dynamically on the entrance past the user.
If I have three or four logo I can add to my disposal help if another statement and his works fine but I have more than 10 logos so it was not possible to keep these in my RTF model.
Is it possible to change the logo according to the entry without keeping this model.
I saw this link but its not very well
http://erpschools.com/articles/display-and-change-images-dynamically-in-XML-Publisher
Concerning
Srikkanth.MCan u send me the files?
-
Do city and State fields on the region required address
Hello
For the region of the address when creating a client if we do not enter city, State, and County, we get an error message saying ' Please enter the elements of the desired address: STATE, COUNTY, CITY '. But there is no * to these fields, even if they are needed. I have a requirement to add * in front of the city and the State of the fields and make the field count as not required. I am not able to do it through customization.
The style of address is a point flex which alludes to HzPuiLocationVO in the region of HzPuiAddressCreateUpdate. I'm not finding a way to update these help please!
This is the area that I'm looking. Please correct me if I'm wrong.
/ Oracle/Apps/AR/Hz/Components/Address/WebUI/HzPuiAddressCreateUpdate
The VO for this element of flex is HzPuiLocationVO
Edited by: user4994352 January 6, 2011 14:48If a page has Flex point means fields come either de FACTO or KFF. In your case fileds are Addredd and the city, so a FDF. In the FDF, these fields may be required.
Add "*" mark you must extend the controller and in processRequest to get the handle to bean filed. And set the required property to true or false depending on the needs.
Example code:
OAMessageTextInputBean tempBean = (OAMessageTextInputBean) webBean.findChildRecursive ("beanId");
tempBean.setRequired ("yes");See link for CO extension below:
http://oracleanil.blogspot.com/2010/09/controller-extension-R12-OAF.htmlFor the handful of beans FDF see Anil post in the thread below:
Requirement DescritiveFlexField-Anand
-
Shows incoming calls to the United States instead of the city and the State
IiPhone 6plus, IOS 10. Incoming calls from unknown number of shows in the United States instead of / the State of the city. How can I fix this. Thank you
Settings > general > language and region > region = 'United States'... assuming that is where you are.
-
I can't connect or open Firefox. Uploaded by on screen instructions but still cannot connect or use firefox.
Installation of Firefox is not dependent on the signing in. You don't need a username / password for Firefox.
Please explain what works and what's not more in detail.
-
percentages vertical positioning depends on the width of the block?
I seem to have found a problem when firefox is positioning of blocks based on the values of percentage margin offsets
In short, look at this page: http://akos.maroy.hu/~akos/frontend/experiment/awake.html
the desired size of the image section is 75% of the available area, also well vertically than horizontally. the planned place of the section of the image is so, it is in the Middle, vertically and horizontally.
If it works horizontally, it seems that the vertical position of the image depends on the horizontal width of the window. If you change the width of the window, the image will move vertically.
It is not exclusive to Firefox. Your problem is that uses margin-top '%' to mean '% of the width.
http://www.w3schools.com/cssref/pr_margin-top.asp -
Y at - it somewhere that I can find a list of explanations or definitions of applications that are running in the monitor of activity as well as a list of items that should raise red flags? I realize account from the list will vary depending on the applications and programs installed and running, but it would be nice to have a base line of what should be expected and considered safe or normal. There are too many items to research and one at a time.
No, not so much.
You have a problem you're trying to solve?
-
CPU goes to 100% svchost State takes all the resources on the Qosmio F10
CPU goes to 100% svchost State takes all the resources. Norton can not find any illegal software. Have tried to list the processes (run... etc.). I get a long list, don't know what to do about this. Anyone out there have some help?
Hey Buddy
The same problem here. :( A universal solution is unknown to me but what I do is from the Task Manager. When svchost shows more than 90% of its use I simply stop this stupid process. After having done that, I can use my laptop without any problem and it will not happen again.
After restarting the laptop, the same thing happens again. I checked some other forums but never found no reasonable explanation how manage this stupid question.
If someone knows more please let us know.
-
Problem updating my state machine, using the emg signal
Hello
I have problems with my code. My entry is an EMG signal that I gather from three different electrodes using usb 6008. In the program, I divide the signals and display them in a chart that is unique. What I want now is to read the signal, and if a signal passes a threshold I want an LED lights. This must remain lit until there is another signal that passes the threshold.
To put it simply: "large enough signal--> lamp on--> stay informed--> enough large signal--> lamp--> stay off the coast and then start again."
I tried a few different approaches, but I decided using a state machine. Now, the problem is that when the signal to enter the state machine the program crashes. I think it's because the table that I use to convert the signals does not update when I get my state machine, so the signal stops to come. But how to get around this problem? It is even possible to code what I want?
I have attached the code. All the tips are welcome, I have been struggling with this for some time now.
Thank you
jenmich
The problem is internal while the loop is run until the stop condition is true, but he never does a new Boolean entry. So that it remains for always in the same State. Remove the inner loop and put the shift register on the outer loop instead.
You must also use a daqmx configures the element, and then set the properties of daq. The read.vi can be set to read a number of samples of each iteration.
Also: you can expand the table to index for several items of output. If you want that element number 0, 1, and 2, you have yet to wire the index entries
Maybe you are looking for
-
Remove red privacy shield ad fox back logo
I do not like the large red shield with the incognito advertising mask please remove and put the Fox crowd back. I really don't like him see it and if I want private browsing I know where to find
-
After login to yahoo mail, facebook, flickr and possibly other sites, my sessions are ends prematurely. It wasn't a problem with the latest versions of Firefox. This isn't a problem with IE9, but I prefer to use Firefox. I run anti-malware, but which
-
just storage on disk of the file please
I downloaded the executable disk storage driver but don't really want to install it on my dell. I need the driver for my HP laptop files I am trying to revive. I put just the driver on a USB key files to see if I can revive the drive on the HP comput
-
Television season faded button 'Bought', but individual episodes still have price tags?
I have a new laptop, and I am re - download all my iTunes purchases. There are a few shows that I bought the season / "completed" my season, but a few that individual episodes, I bought. The problem is that the things that I bought in the last month
-
Mail vip list does not display messages from all mailboxes
When I first put in place, I remember having the option to display the messages in all mailboxes - a really useful facility VIP. Recently, I noticed that most of my personalities was empty, but the messages were still there in their individual files.