Help with Docs combine script
Hello
I am writing a script that combines a list of docs in 1 doc.
The script begins with a dialog with a list of docs open.
The user selects the files he wants to combine.
The script reads the list and send to the following function:
function combine() { var docsPages = []; var pgCount; var newDoc = app.documents.add(); for (var i=0; i<myFiles.length; i++) { var myDoc = app.documents.item(myFiles[i]) docsPages[i] = myDoc.pages.everyItem().getElements(); } for (var v = 0; v < myFiles.length; v++) { for (var i=0; i<docsPages[v].length; i++) { docsPages[v][i].duplicate( LocationOptions.AFTER, newDoc.pages.lastItem() ); } } }
The script is almost working...
The problem I have is that the script puts the pages side by side.
The result is a dotted with 18 pages long!
Here is a screenshot to explain what I mean:
What I'm doing wrong here?
Thank you
Davey
P.S. I put in place of the script as I did because I want to give the possibility of interleaving pages (2 loops).
Hello
@Uwe. No problem with export 12-pages no distributed in PDF (very nice landscape)
@ Davey
To keep the 1st page on the right side:
function combine() { var newDoc = app.documents.add(), docsPages = [], v, i; for (v = 0; v < myFiles.length; v++) { docsPages = app.documents.item(myFiles[v]).pages.everyItem().getElements(); for (i = 0; i < docsPages.length; i++) { if (v == 0 && i == 0) { docsPages[i].duplicate(LocationOptions.AT_BEGINNING, newDoc.spreads[-1]); newDoc.pages[-1].remove(); } else if (newDoc.pages.length % 2 == 1 ) { newDoc.spreads.add({allowPageShuffle: false}); docsPages[i].duplicate(LocationOptions.AT_BEGINNING, newDoc.spreads[-1]); while (newDoc.spreads[-1].pages.length > 1) newDoc.spreads[-1].pages[-1].remove(); } else docsPages[i].duplicate(LocationOptions.AT_END, newDoc.spreads[-1]); } } }
Jarek
Tags: InDesign
Similar Questions
-
Need help with files combining script
Hey guys, I'm a graphic designer who is really hoping most commonly the code can someone help! I have several hundred images that need to be combined. A client gave me a folder of images and their alpha cards as separate files. I need combine each image and alpha map and export the new image format PNG 24 with transparency. Doing so by hand will take forever, do this with a script is going to be awesome. The script must:
-Open Filename.png
-Create a duplicate of the background layer (as background layers may not have masks it seems)
-Remove the background layer
-Add a layer mask to the new double layer
-Open filenamea.png (the alpha cards follow convention assignment of names + a .png file name)
-Copy filenamea.png into the layer mask to filename.png
-Save the filename.png for Web and devices such as a PNG 24 with transparency in a folder called converted (to avoid overwriting the old image)
I'm sure it's more complicated, it seems, but is - someone up to help a poor, illiterate code GD?
Here's a JavaScript solution only, for the curious. Save it as MergeAlpha.jsx and run it from Photoshop.
X
function cTID(s) { return app.charIDToTypeID(s); }; function sTID(s) { return app.stringIDToTypeID(s); }; function main() { var folder = Folder.selectDialog(); if (!folder) { return; } var ofolder = new Folder(folder + "/Converted"); ofolder.create(); var saveOpts = new ExportOptionsSaveForWeb(); saveOpts.format = SaveDocumentType.PNG; saveOpts.PNG8 = false; saveOpts.transparency = true; var pngs = folder.getFiles('*.png'); for (var i = 0; i < pngs.length; i++) { var file = pngs[i]; var afile = new File(folder + '/' + file.name.replace('.png', 'a.png')); if (!afile.exists) { continue; } var doc = app.open(file); doc.activeLayer.isBackgroundLayer = false; var adoc = app.open(afile); adoc.selection.selectAll(); adoc.selection.copy(); adoc.close(SaveOptions.DONOTSAVECHANGES); createLayerMask(); selectMaskChannel(); doc.paste(); var ofile = new File(ofolder + '/' + file.name); ofile.remove(); doc.exportDocument(ofile, ExportType.SAVEFORWEB, saveOpts); doc.close(SaveOptions.DONOTSAVECHANGES); } }; function createLayerMask() { var desc9 = new ActionDescriptor(); desc9.putClass( cTID('Nw '), cTID('Chnl') ); var ref6 = new ActionReference(); ref6.putEnumerated( cTID('Chnl'), cTID('Chnl'), cTID('Msk ') ); desc9.putReference( cTID('At '), ref6 ); desc9.putEnumerated( cTID('Usng'), cTID('UsrM'), cTID('RvlA') ); executeAction( cTID('Mk '), desc9, DialogModes.NO ); }; function selectMaskChannel() { var desc26 = new ActionDescriptor(); var ref18 = new ActionReference(); ref18.putEnumerated( cTID('Chnl'), cTID('Chnl'), cTID('Msk ') ); ref18.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt')); desc26.putReference( cTID('null'), ref18 ); desc26.putBoolean( cTID('MkVs'), true ); executeAction( cTID('slct'), desc26, DialogModes.NO ); }; main();
-
Help with the Powershell script to collect logs from all domain controllers
I am writing a script to retrieve the last 5 days of application, security and log files from all domain controllers. The script runs, but fire the logs from the local server only. The variable $Computer has all of my DC so it's the fine mark. I guess it's a problem with my line ForEach-Object, but is not error. See the below script.
$log = 'application '.
$date = get-date-format MM-DD-YYYY
$now = get-date
$subtractDays = new-object System.TimeSpan 5,0,0,0,0
$then = $Now.Subtract ($subtractDays)
$Computers = get-ADDomainController-filter *.
ForEach-Object - InputObject $Computers - process {Get-EventLog - LogName $log - after $then - before $now - EntryType error | select EventID, MachineName, Message, Source, TimeGenerated |} ConvertTo-html | {Out-file $env:TEMP\Applicationlog.htm}
Invoke-Expression $env:TEMP\Applicationlog.htmThank you
Rich
Hello
To help with the repost the question script to the script Center Forum
http://social.technet.Microsoft.com/forums/scriptcenter/en-us/home
-
Hello everyone.
Can sb help me create the following script, based on three tables:
ID col1 314 value2 ID ID1 col2 314 1 somevalue4 314 2 somevalue5 314 3 somevalue6 ID ID1 ID2 COD Qty. 314 1 1 LTR 10 314 1 2 KG 20 314 2 1 LTR 40 The result should be like this:
id id1 ID2 cod_1 qty_1 COD2 qty_2 col1 col2 314 1 1 LTR 10 KG 20 value2 somevalue4 314 2 1 LTR 40 value2 somevalue5 Post edited by: 933651
Hello
Here is my view on this problem. May need some adjustments in the join conditions when the data model and the data is more clear
create table t1 ( id number, col1 varchar2(10) ); insert into t1 values (314, 'somevalue2'); create table t2 ( id number, id1 number, col2 varchar2(10) ); insert into t2 values (314, 1, 'somevalue4'); insert into t2 values (314, 2, 'somevalue5'); insert into t2 values (314, 3, 'somevalue6'); create table t3( id number, id1 number, id2 number, cod varchar2(3), qty number ); insert into t3 values (314, 1, 1, 'LTR', 10); insert into t3 values (314, 1, 2, 'KG', 20); insert into t3 values (314, 2, 1, 'LTR', 40); with ltr as ( select id, id1, id2, cod, qty from ( select id, id1, id2, cod as code, cod, qty from t3 ) pivot ( sum(qty) for code in ('LTR' as qty) ) where qty is not null ), kg as ( select id, id1, id2, cod, qty from ( select id, id1, id2, cod as code, cod, qty from t3 ) pivot ( sum(qty) for code in ('KG' as qty) ) where qty is not null ) select t2.id, t2.id1, ltr.id2, ltr.cod, ltr.qty, kg.cod, kg.qty, t1.col1, t2.col2 from t2 join ltr on ( t2.id = ltr.id and t2.id1 = ltr.id1 ) full join kg on ( t2.id = kg.id and t2.id1 = kg.id1 ) left join t1 on ( t1.id = t2.id ) order by id, id1 ; drop table t1 purge; drop table t2 purge; drop table t3 purge; table T1 created. 1 rows inserted. table T2 created. 1 rows inserted. 1 rows inserted. 1 rows inserted. table T3 created. 1 rows inserted. 1 rows inserted. 1 rows inserted. ID ID1 ID2 COD QTY COD QTY COL1 COL2 ---------- ---------- ---------- --- ---------- --- ---------- ---------- ---------- 314 1 1 LTR 10 KG 20 somevalue2 somevalue4 314 2 1 LTR 40 somevalue2 somevalue5 table T1 dropped. table T2 dropped. table T3 dropped.
-
Need help with understanding PowerCli scripting by LucD
Hello
I'll give you the standard statement that I am a noob powercli and don't really know what I'm doing here. Here's a script that works because it runs without error and gives a report but I need help to understand this under his weight.
Connect-VIServer '< our vcenter >' - user < user > admin-password < admin-user-pwd >
$allvms = @)
$vms = get - Vm | where {$_.} PowerState - eq "Receptor"}
$start = (get-Date). AddDays(-1)
$metrics = "mem.usage.average".
$stats = get-Stat-entity $vms - start $start - Stat $metrics
$stats | Group-object - property {$_.} Timestamp.Day}, {$_.} @entity.name} | %{
$vmstat = "" | Select the day, MemAlloc, MemMin, MemMax, MemAvg, VmName
$vmstat. VmName = $_. Values [1]
$vmstat. Day = $_. Group [0]. Timestamp.Date
$mem = $_. Group | where {$_.} MetricId - eq "mem.usage.average"} | Measure-object-property value - average - Maximum - Minimum
$vmstat. MemMax = [int] $mem. Maximum ##dfsdf
$vmstat. MemAvg = [int] $mem. Average
$vmstat. MemMin = [int] $mem. Minimum
$vmstat. MemAlloc = $_. Group [0]. Entity.MemoryMB
$allvms += $vmstat
}
$allvms |
Export-Csv "c:\ < folder > \ <>.csv file Destination"-noTypeInformation
It connects to our server vcenter server and offers two days of data. Today and yesterday, all with a timestamp of 0:00. See below for an example of a virtual machine.
VmName Day MemAlloc MemMax MemAvg MemMin < name VM1 > 07/05/2016 0:00 4096 18 18 18 < name VM1 > 06/05/2016 0:00 4096 36 12 8
The MemMax, the MemAvg and the MemMin are for this day? Just the max of this period of sampling time 0:00?
What I'm looking for, it is to find that the use of the maximum memory of virtual machines are for the whole day. So I hope that I can remove memory of VMs that do not use it. I was listed on the change $start = (Get-Date). The value of AddDays(-1) to $start = (Get-Date). AddDays(-30) and see what things alike. I want to be sure however that the value for MemMax is the highest value for a period of 24 hours. That is to say for the 07/05/2016 the given virtual machine never used a maximum of 18% of his memory attributed the 06/05/2016 the maximum amount of memory used was 36%, and so on that I extend on the date range.
Kind regards
Michael
It then becomes a rather simple Get-Stat script.
$vms = get - Vm | where {$_.} PowerState - eq "Receptor"}
$start = (get-Date). AddDays(-1)
$metrics = "mem.usage.average".
Get-Stat - entity $vms - start $start - Stat $metrics |
Select Timestamp,@{N='VM'; E={$_. @entity.name}}, Value |
Tri-objet-VM property |
Export-Csv "c:\
------ .csv '-noTypeInformation -
I am looking for 2 very simple scripts, we're for a specific cluster 1, I want to list all the VMS that have 4 GB of memory or more.
Then a 2nd script for a specific cluster1, want to list VM which do not have the VM tools installed or are out of date and select the name, the tool vmware status and memory.
Can someone help please
Here is a line that I tried on a single host... and must work if you connect on a VC as well... people it will list all virtual machines with more than 4 GB of memory:
Get - VM | Where-Object {$_.} MemoryMB - gt 4096}
If you want just the name and memory, then:
Get - VM | Where-Object {$_.} MemoryMB - gt 4096} | Select Name, MemoryMB
For the other for the VMtools...
Get-VM | Get-View | Select-Object @{N="Name";E={$_.Name}},@{Name="ToolsStatus";E={$_.Guest.ToolsStatus}}
Concerning
-
Hello
There some time, someone has written the following script for me. The idea was to make a command that would allow me to reduce an image up to 400 width in pixels without loss of scale. I want to have a similar command that will reduce a large image to 400 pilel height without loss of scale. I fiddled with the width command but cannot operate in height. Can I get help the following command to work at height of 400 pixels of rewriting? Thank you.
User variables
var width = 400;
Order
var dom = fw.getDocumentDOM ();
var scale = width/dom.width;
var height = dom.height * scale;
dom.setDocumentImageSize ({left:dom.left, top: dom.top, right:dom.left + width, bottom:dom.top + height}, {pixelsPerUnit:dom.resolution, United:dom.resolutionUnits});})
Tom Hersh wrote:
> I try it this way. But I couldn't make it work. The word "scale" is critical, but I switch did not help.Just pass the variables verbatim. Height width and width for
height.User variables
var width = 400;Order
var dom = fw.getDocumentDOM ();
var scale = width/dom.width;
var height = dom.height * scale;
dom.setDocumentImageSize ({left:dom.left, top: dom.top,
Right:DOM. Left + Width,
Bottom:DOM. Top + Height}, {pixelsPerUnit:dom.resolution,
:DOM.resolutionUnits}) units;User variables
var height = 400;Order
var dom = fw.getDocumentDOM ();
var scale = height/dom.height;
var width = dom.width * scale;
dom.setDocumentImageSize ({left:dom.left, top: dom.top,
Right:DOM. Left + Width,
Bottom:DOM. Top + Height}, {pixelsPerUnit:dom.resolution,
:DOM.resolutionUnits}) units;Once you see this script, it is not hard to see what he does.
This is the script of fireworks generated the scale just at the height of a
picture 400 px of 640 x 480 px.fw.getDocumentDOM)
.scaleSelection (0.83281248807907104, 0.83333333333333337,
"autoTrimImages transformAttributes");It works on all the images in 640 x 480. Add to that a 700 x 480 and it won't.
I'm assuming, very few people here (including me), would be able
to turn this into something that would take into account the widths of
as did senocular.SKB
-
Hello experts.
I have the following example stored procedure
create or replace procedure as bingo
Start
dbms_output.put_line ('Bingo!');
end;
Now, I would like to create more of them, but that giving different names
So I would like the following
create or replace procedure bingo_ 2 as
Start
dbms_output.put_line ('Bingo!');
end;
create or replace procedure bingo_3 as
Start
dbms_output.put_line ('Bingo!');
end;
I'm writing a dynamic statement to make, but I'm running into a bit of problem. Help, please. See my code below
Declare
XP varchar2 (4000);
GH varchar2 (4000);
Start
Select dbms_metadata.get_ddl ('PROCEDURE', 'BINGO', 'TEST_MFG') in xp
Double;
immediately run xp;
end;
The problem with my code so far, I'm having a time difficult obtaining the first line that contains the name so that I am change the name and it concatenates back to metadata.
Thank you.
Hello
If what you want is to create the BINGO_2 procedure the same as the procedure BINGO
Try the following
DECLARE
XP VARCHAR2 (4000);
GH VARCHAR2 (4000);
BEGIN
SELECT REPLACE (dbms_metadata.get_ddl ('PROCEDURE', 'BINGO', 'TEST_MFG'), 'BINGO', 'BINGO_2')
IN xp
DOUBLE;
EXECUTE immediate xp;
END;
/
concerning
Salim
-
help with bulk - update script vcloud Org
Hi all
I need to update the following script to edit only all VMs in a single body... I don't want to touch to all environments...
ForEach ($vm in (Get - VM)) {}
$vmv = get - VM $vm | Get-View
$name = $vmv. Name
$guestid = $vmv. Summary.Config.GuestId
$vmx = new-Object VMware.Vim.VirtualMachineConfigSpec
$vmx.extraConfig += new-Object VMware.Vim.OptionValue
$vmx.extraConfig [0] .key = "monitor_control.enable_softResetClearTSC."
$vmx.extraConfig [0] .value = 'TRUE '.
If ($guestid - like ' windows8 * Guest ') {}
($vmv). ReconfigVM_Task ($vmx)
}
}
When I connect to the specified by connect-ciserver-Server xxxx - Org Org MyOrg and test, it tells me:
Get - VM: 09/05/2016 15:40 Get - VM you are not currently connected
on all servers. Sign in first with a cmdlet Connect.
C:\scripts\TSCClear.ps1:1 char: 18
+ ForEach ($vm in (Get - VM)) {}
+ ~~~~~~
+ CategoryInfo: ResourceUnavailable: (:)) [Get - VM], ViServerConne)
ctionException
+ FullyQualifiedErrorId: Core_BaseCmdlet_NotConnectedError, VMware.VimAuto
mation.ViCore.Cmdlets.Commands.GetVM
Not a script guru here, just trying to see if I can make this work in an Org with some modifications
You get the error message because the cmdlet Get - VM work, you must be connected to a vCenter server. For the ReconfigVM_Task() method, you must be connected to a server vCenter as well. The following PowerCLI script connects to both a vCloud Director Server and vCenter server. The script uses the cmdlet Get-CIVM to recover virtual machines in the organization. Because the VirtualmachineConfigSpec is the same for each virtual machine, I took it out of the loop to make the script run faster.
$Organization = 'MyOrg ".
$CIServer = "vCloudDirectorServer".
$VIServer = "vCenterServer".
Connect-CIServer-Server $CIServer
SE connect-VIServer-Server $VIServer
$vmx = new-Object VMware.Vim.VirtualMachineConfigSpec
$vmx.extraConfig += new-Object VMware.Vim.OptionValue
$vmx.extraConfig [0] .key = "monitor_control.enable_softResetClearTSC."
$vmx.extraConfig [0] .value = 'TRUE '.
ForEach ($vmv in (Get-View - RelatedObject (Get-CIVM - Org $Organization). ExtensionData)) {}
$name = $vmv. Name
$guestid = $vmv. Summary.Config.GuestId
If ($guestid - like ' windows8 * Guest ') {}
($vmv). ReconfigVM_Task ($vmx)
}
}
-
Hi all
mattboren created the script below for a list of BIOS hardware version and firmware version:
## Script function: quickly get BIOS date, Smart Array FW version, and iLO FW version for HP hosts in a given location (folder, cluster, datacenter, etc.) ## Author: vNugglets.com -- Sep 2011 ## folder in which hosts in which we are interested reside #$strHostsFolderName = "myFolder" #Get-View -ViewType HostSystem -Property Name, Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo -SearchRoot (Get-View -ViewType Folder -Property Name -Filter @{"Name" = "^$([RegEx]::escape($strHostsFolderName))$"}).MoRef | %{ ## cluster in which hosts in which we are interested reside $strHostsClusterName = "Production" Get-View -ViewType HostSystem -Property Name, Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo -SearchRoot (Get-View -ViewType ClusterComputeResource -Property Name -Filter @{"Name" = "^$([RegEx]::escape($strHostsClusterName))$"}).MoRef | %{ $arrNumericSensorInfo = @($_.Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo) # HostNumericSensorInfo for BIOS, iLO, array controller $nsiBIOS = $arrNumericSensorInfo | ? {$_.Name -like "*System BIOS*"} $nsiArrayCtrlr = $arrNumericSensorInfo | ? {$_.Name -like "HP Smart Array Controller*"} $nsiILO = $arrNumericSensorInfo | ? {$_.Name -like "Hewlett-Packard BMC Firmware*"} $nsiNXdev = $arrNumericSensorInfo | ? {$_.Name -like "nx_nic device*"} $nsiNXdrv = $arrNumericSensorInfo | ? {$_.Name -like "nx_nic driver*"} if ( $nsiNXdev.Count -gt 0 ) { $nsiNXdevice = $nsiNXdev[0].Name } else { $nsiNXdevice = "n/a" } if ( $nsiNXdrv.Count -gt 0 ) { $nsiNXdriver = $nsiNXdrv[0].Name } else { $nsiNXdriver = "n/a" } New-Object PSObject -Property @{ VMHost = $_.Name "SystemBIOS" = $nsiBIOS.name "HPSmartArray" = $nsiArrayCtrlr.Name "iLOFirmware" = $nsiILO.Name "nx_nic device" = $nsiNXdevice "nx_nic driver" = $nsiNXdriver } ## end new-object } | Export-Csv C:\temp\Production-BLadeG7.csv ## end Foreach-Object
However, I would like to change the driver for the CARD and the version of the firmware but still appear.
Any kind of help and suggestions would be greatly appreciated.
Thank you.
Try like this
$strHostsClusterName = 'production '.
Get-view ViewType - HostSystem-Property Name, Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo - SearchRoot (Get-View - Name ClusterComputeResource-property - ViewType filter @{'Name' = ' ^ $([RegEx]: escape ($strHostsClusterName)) $"" "}). MoRef | %{
$arrNumericSensorInfo = @($_.) Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo)
# HostNumericSensorInfo for controller table of BIOS, ILO,
$nsiBIOS = $arrNumericSensorInfo |? {$_. {Name: like "* system BIOS *"}
$nsiArrayCtrlr = $arrNumericSensorInfo |? {$_. {Name - like "HP Smart Array Controller *"}
$nsiILO = $arrNumericSensorInfo |? {$_. {Name - like "Hewlett-Packard BMC Firmware *"}
$esxName = $_. Name
$esxcli = get-EsxCli - VMHost $_. Name
$esxcli.network.nic.list () | %{
$esxcli.network.nic.get ($_.) Name) | %{
$props [ordered] = @ {}
VMHost = $esxName
"SystemBIOS" = $nsiBIOS.name
"HPSmartArray" = $nsiArrayCtrlr.Name
"iLOFirmware" = $nsiILO.Name
"nx_nic device" = $_. Name
'nx_nic pilot' = $_. DriverInfo.Driver
"nx_nic driver version" = $_. DriverInfo.Version
"nx_nic firmware version" = $_. DriverInfo.FirmwareVersion
} # end new object
New-object PSObject-property $props
}
}
} | Export-Csv C:\temp\Production-BLadeG7.csv # end Foreach-Object
-
Need help with box counting Script
He had to count the number of boxes checked. I use the script below and its does not work. What I am, I am doing wrong? It drives me crazy.
/*
document level function to calculate the sum of the fields named
Function Sum (aFieldNames) {}
var sum = 0; sum of values
Browse fields
for (var i = 0; i < aFieldNames.length; i ++) {}
If (!) IsNaN (this.getField(aFieldNames[i]).value))
sum += Number (this.getField(aFieldNames[i]).value).
}
to return the sum;
} / / end of the sum function
*/
Bay of somme of domain names
var aCheckBox = new Array ("check Box5', 'Check Box8', 'Vérifier Box11', 'Check Box16', 'Check Box19', 'Check Box22', 'Check Box25', 'Check Box28', 'Check Box31', 'Check Box34', 'Check Box37', 'Check Box40', 'Check Box43', 'Check Box46', 'Check Box49', 'Check Box52', 'Check Box55', 'Check Box58', 'Check Box61', 'Check Box64', 'Check Box68'");
sum, named fields
Event.Value = Sum (aCheckBox);
Then why you check if they are several using the isNaN function and then try to add this number to the sum variable? Looks like you just copy the code, even if it does not apply to your situation.
Replace these two lines of code with this:
If (this.getField(aFieldNames[i]).value! = "Off") sum ++;
-
We do a manual Dr, and after disabling the replication process and presents the LUN DR ESX server and run a powershell script to save virtual machines, we want to turn on all with the script below.
It works, but I get 'this VM was copied or moved to issue a' for each I answer "moved" to. Any ideas on how to remove or to answer this question in an automated way?
$sourceVI = Read-Host "vCenter name.$creds = get-credentialto connect-viserver-Server $sourceVI - Credential $credsImport-Csv g:\dr\epicdrstartserverlist.csv | Foreach {Get - VM $_.} Name | {Start-vm-confirm: $false}Disconnect-VIServer $sourceVI - confirm: $False(the CSV file is just a list of the names of virtual machine I want to turn on).You can check the presence of an issue with the cmdlet Get-VMQuestion het and reply with the Set-VMQuestion cmdlet.
-
I need help with my first Script in AE CS5
Hello fellow designers out there.
I'm newbie on AE Scripting here. I run my CS 5 on Win 7. I'm trying to create a simple solid GUI and it controls opacity by cursor. I fail and do not now how it work. Here is the code that I have written in reference to many sources and tutorials:
myComp = app.project.item (1); akses comp 1
mySolid = myComp.layers.addSolid ([1.0,1.0,0], 'my place', 50, 50, 1); solid
var myWin = new window ("palette", "Transform", undefined); create the palette
myWin.orientation = "row";
var myOpacity = myWin.add ('Committee', undefined, "Strong opacity");
myOpacity.orientation = "column";
myOpacity.add ("statictext", undefined, "Opacity Kontrol");
var opacitysliderCtrl = myOpacity.add ("slider", undefined, 50, 0, 100); make cursor
var layerOpacity = mySolid.property ("opacity");
opacitysliderCtrl.onChanging = function()
{
var val = Math.round (opacitysliderCtrl.value);
layerOpacity.value = val;
};
myWin.center ();
myWin.show ();
Please, help me to see the problem here. Thank you
There is more harm than good in your work
At the moment you script attached a slider to a single layer (mySolid, that you add at the beginning).
This is not very useful, that you cannot use this slider for the other layers.
You should also keep in mind that this solid can be deleted, so the mySolid object may become invalid (referring to a solid that no longer exists).
I don't know what, exactly, is your plan, but a script has generally not set anything related to AE in his many body (at launch).
Only when the user clicks/change a widget script tries to extract a model, layer, property, or anything that the user specified by "a kind of secret code" (most of the time: the model, property, layer, etc. is selected).
If you want the slider to control the opacity value of all selected layers in the active model, it would be something like this:
var myWin = new Window("palette", "Transform", undefined); //create pallete myWin.orientation = "row"; var myOpacity = myWin.add("panel", undefined, "Solid Opacity"); myOpacity.orientation = "column"; myOpacity.add("statictext", undefined, "Kontrol Opacity"); var opacitysliderCtrl = myOpacity.add("slider", undefined, 50, 0, 100);//make slider opacitysliderCtrl.onChanging = function onOpacitySliderChanging(){ // retrieve the AE things that have to be handled: in this case, all selected layers in the active comp var myComp, myLayer, n; var layerOpacity, val; myComp = app.project.activeItem; if (myComp.numLayers>0){ for (n=0; n
Xavier
-
Need help with vSphere data script, packaging and sending it to the data warehouse
Greetings PowerCLI gurus.
Everyone can offer suggestions on a script which can query vSphere and pull on the following fields of the virtual computer:Name State Status Host Space in use Space used Format in a file in the CSV format and send the file to an FTP server?
Much respect to all, thanks a lot in advance.
Hello-
Happy to help you.
OK, well, if this database is accessible through a UNC path, you might make a copy directly using Copy-Item. If you use different credentials, you can encrypt and store in an XML file. HAL Rottenberg wrote to do http://halr9000.com/article/531.
Or, if this pension data is something that supports the secure copy (scp) or secure FTP (SFTP), those who would be good options. Again, you can store the alternative credentials in an encrypted in an XML file format and use them as needed.
Certainly, there is a balance to be struck between security and ease of use. It may be such that the transmitted data are not considered sensitive to all, and clear data transfers are acceptable. Probably still a good idea to take measures to protect the credentials at least.
-
Need help with a FormCalc script...
I have an auto form certain text fields based on a date field. It works fine, but when I open the form, the fields are already filled with a default date when I actually put "Week start" date, he turns into what I want, I don't want the fields to have something in them when the form is opened. The FormCalc script that I use is the following
var dateNum = date2num(form1.Checklist.weekStart.formattedValue,"MMMM DD, YYYY")
$.rawValue = num2date(dateNum,"MM/DD")
Here is a link to the file itself
We FormCalc, blocking the right controls the drop-down list of the calendar to make sure that they select a Monday.
I like to put as much of my code that I can in one place, so it is easier to change things. That is why I proposed to do all of the drop-down list calendar.
So, you could do something like:
var selectedDate = Date2Num($,"YYYY-MM-DD") var dayOfWeek = Num2Date(selectedDate, "E") if (dayOfWeek <> 2) then xfa.host.messageBox("Week Starting must be a Monday") $ = null xfa.host.setFocus("$") endif Table1.Row1.dayMonday = num2date(selectedDate, "MM/DD") Table1.Row1.dayTuesday = num2date(selectedDate + 1, "MM/DD") Table1.Row1.dayWednesday = num2date(selectedDate + 2, "MM/DD") Table1.Row1.dayThursday = num2date(selectedDate + 3, "MM/DD") Table1.Row1.dayFriday = num2date(selectedDate + 4, "MM/DD") Table1.Row1.daySaturday = num2date(selectedDate + 5, "MM/DD") Table1.Row1.daySunday = num2date(selectedDate + 6, "MM/DD")
(I dissociated from the first table that it was originally the need to use xfa.resolvenodes.)
Maybe you are looking for
-
HP 15-ac104la: reinstall OS inEnglish
I had to buy a new computer then to the Mexico. Unfortunately, I don't speak or read Spanish. How can I change the language of the English system?
-
Satellite 100CS: Question about the installation of Win95
My second laptop is what precedes. The HARD drive is 2 GB and erase data. If I bought an OEM Windows 95 on floppy disks would have this load on the machine and work?
-
Vista - Error Code: 8007065E (cannot install updates)
When I run my windows update I 8007065E error. ... will not install updated... on Vista (I hope not much longer)...
-
HP pavilion g7: enter the password administrator or boot password
error code password 60647517 Bios disabled
-
Cannot find the partition to re - install Windows 7
original title: help please... I formatted my wife's computer. Now, I try to re install windows 7, but when they ask what partition install in I get no partition of your choice. What should I do to partition the hard drive, so I can reinstal windows.