From: "Chris Zwar" Received: from mail-pf0-f182.google.com ([209.85.192.182] verified) by media-motion.tv (CommuniGate Pro SMTP 6.1.0) with ESMTPS id 6443744 for AE-List@media-motion.tv; Tue, 01 May 2018 07:23:33 +0200 Received: by mail-pf0-f182.google.com with SMTP id e9so4472012pfi.4 for ; Mon, 30 Apr 2018 22:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chriszwar-com.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=ZVvvhETrWDZceAGm9tey/WrzPCG3/7yvu7Du430Em64=; b=Q/qWXWw0Zodj+TgfC16fG1vrGS6ko8lPneFdtBL2l+c0PiSQgyskVBaPJ3zdFNkHj0 1NSrTnc+9tPMm+A7uF9bF+KXlREwfED7c1xz9vKZMApMdibvip+rah8hFqTLLCmK0JfF PrfYJUo1A5xJw6UZ7iDU5O7ao48ydmsk0i8r20V9YO6GtA+VRhV0GB5v2cJXXrVGok5+ J9hdpPrMfgrWvBtqXrexOYv9U/KRCYCss2EI7QapvRuNsCWnOoObL4fuaKtqPcM26sLv /3ASdWwphy7Mc+cd7r5T8v+JermUhL/yxWQqyHUrJFKGTuKCNiJuWm5SLDgttsQjS5A2 uT3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=ZVvvhETrWDZceAGm9tey/WrzPCG3/7yvu7Du430Em64=; b=OJElqZyvJBOqxbQqKoHJNBJjAAm7qH3GDl3/9BAWOxOaFpE3Pl4gkZdS4H04gpchxz 8xpwFCqtFS0dT6SI38mRxl2ZMgZrRX2nzj6H3dALNaXani8zfmUaDGLM/0GQo20EfeGr LDDTwTsgfvCcvgPfSpfqbTAS5s2KvibdH5z+nkl/5LuzHOYf3Gb2JRN4fIbQbM6ny1MW L+aNgsavsXRRHqnYuERpB/DfA2oD/+mwKtFThMDLqhLEvUT1oEaKPnf6qAFRsH0pNXn0 u+XLWw0uw6TyJ+my5oLVe6V+WjrXunyW9qCv7EQr9uUs0zAkuIBzyFtjTVxgond0bSMs Nj3w== X-Gm-Message-State: ALQs6tCs/HYAauoSgT/YW8E4cv3EuOOcpstJfFy/Pv3uBTuWpKWNzxbt CF/jy/tLRDYY6CtYxSRfxLRZs3Zchls= X-Google-Smtp-Source: AB8JxZpr+CpmSCwy39Ag18BAIsSaKzHb8x1e75UIDHEsQbirQu9cYHNVnbtWxbM0+CglZmf+Cwns/w== X-Received: by 2002:a65:64c1:: with SMTP id t1-v6mr12393534pgv.406.1525152571706; Mon, 30 Apr 2018 22:29:31 -0700 (PDT) Return-Path: Received: from [192.168.3.137] (220-244-139-34.static.tpgi.com.au. [220.244.139.34]) by smtp.gmail.com with ESMTPSA id q76sm18205467pfi.139.2018.04.30.22.29.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Apr 2018 22:29:31 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: scripting help - getting colour value Message-Id: <04D162DA-EB53-4D7B-A1D0-0175EA6AE732@chriszwar.com> Date: Tue, 1 May 2018 15:29:27 +1000 To: After Effects Mail List X-Mailer: Apple Mail (2.3445.6.18) Hi, Just after some scripting help. I have a simple script that works fine = when run without a GUI, but if I use exactly the same code in a version = with a GUI it doesn=E2=80=99t work any more. The aim is to sample the colour of a layer. The script applies a colour = control / expression control effect, with an expression that uses = sampleImage to read the RGB values. The script then reads the value of = the colour control to get the RGB values. As I said - works fine if I run the script from the scripts menu. But = the same thing in a GUI and run from the ScriptsUI Panel doesn=E2=80=99t = work. The RGB array variable is just 0. So what am I doing wrong? Cheers, -Chris Offending code: myLayer[0].property("ADBE Effect Parade").addProperty("ADBE Color = Control=E2=80=9D); myLayer[0].property("ADBE Effect Parade").property("ADBE Color = Control").property("ADBE Color = Control-0001").expression=3D"x=3DthisLayer.width/2;y=3DthisLayer.height/2;= c=3DsampleImage([x,y], radius =3D [2, 2], postEffect =3D true, t =3D = time);"; var RGB=3DmyLayer[0].property("ADBE Effect Parade").property("ADBE Color = Control").property("ADBE Color Control-0001").value;