Script that create Layerset with name from layer?

Hello!
This should be easy for someone who know whet is doing so not me:P
I want script to automatically create layerset from each selected layer, name it as that layer and place that layer in it
I found old script that do that but only normal layer not linked or embeded, and I want to do it for all selected layers not only to one
Can someone modify it a little to work little better? I have no idea how to do it and probably would take me like thousands hours or more
thx
#target photoshop
main();
function main(){
if(!documents.length) return;
var doc = activeDocument;
if(doc.activeLayer.kind != LayerKind.NORMAL) return;
var layerRef = doc.activeLayer;
var layerSetRef = doc.layerSets.add();
layerSetRef.name = layerRef.name;
layerRef.move(layerSetRef, ElementPlacement.PLACEATEND);

You could remove the line
if(doc.activeLayer.kind != LayerKind.NORMAL) return;
But it would only work with one selected Layer (and also on selected LayerSets).
To handle more than one selected Layer (or all Layers) some changes would be necessary.

Similar Messages

  • Creating object with names from a String Array

    Hi all,
    This might be a stupid question .. I have the following method:
         public OptionInputPanel(Option newO, String [] parameter){
              super(new BorderLayout());
              o = newO;
              for (int i = 0; i < parameter.length; i++){
                   testB = BorderFactory.createTitledBorder(parameter);
                   JFormattedTextField parameter[i] = new JFormattedTextField(); // problem
    as you can see I would like to name my text fields with the strings that I have in the parameters array so that I can get their values later on. How can I do it?
    Thanks for help
    Stan

                   JFormattedTextField parameter[i] = new JFormattedTextField(); // problemYou are declare an array of size i, and assigning a single JFormattedTextField to it.
         public OptionInputPanel(Option newO, String [] parameter){
              super(new BorderLayout());
              o = newO;
              JFormattedTextField params[ i ] = new JFormattedTextField();
              for (int i = 0; i < parameter.length; i++){
                   testB = BorderFactory.createTitledBorder(parameter[ i ]);
                   param[ i ] = new JFormattedTextField(parameter[ i ]);
    Resources for Beginners
    Sun's basic Java tutorial
    Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's Thinking in Java (Available online.)
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java. This one has been getting a lot of very positive comments lately.

  • Error creating bean with name 'rbacxSchedulerService'

    Hi
    I am installing Oralce Identity Analytics and this with an error in the log posted below. Someone could help me. Thank you
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'indexGlobalUserGlobalUserUpdateAdvisor' defined in ServletContext resource [WEB-INF/search-context.xml]: Cannot create inner bean 'com.vaau.rbacx.search.aop.IndexAdvise#1ba7ab0' of type [com.vaau.rbacx.search.aop.IndexAdvise] while setting bean property 'advice'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.vaau.rbacx.search.aop.IndexAdvise#1ba7ab0' defined in ServletContext resource [WEB-INF/search-context.xml]: Cannot resolve reference to bean 'ftSearchProvider' while setting bean property 'searchProvider'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ftSearchProvider' defined in ServletContext resource [WEB-INF/search-context.xml]: Cannot resolve reference to bean 'rbacxSchedulerService' while setting bean property 'rbacxSchedulerService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rbacxSchedulerService' defined in ServletContext resource [WEB-INF/scheduling-context.xml]: Cannot resolve reference to bean 'vaauSchedulerManager' while setting bean property 'vaauSchedulerManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'vaauSchedulerManager' defined in ServletContext resource [WEB-INF/scheduling-context.xml]: Cannot resolve reference to bean 'quartzSchedulerProvider' while setting bean property 'schedulerProvider'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'quartzSchedulerProvider' defined in ServletContext resource [WEB-INF/scheduling-context.xml]: Cannot resolve reference to bean 'quartzSchedulerFactoryBean' while setting bean property 'quartzScheduler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'quartzSchedulerFactoryBean' defined in ServletContext resource [WEB-INF/scheduling-context.xml]: Cannot create inner bean 'quartzSchedulerFactoryBeanTarget' of type [org.springframework.scheduling.quartz.SchedulerFactoryBean] while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'quartzSchedulerFactoryBeanTarget' defined in ServletContext resource [WEB-INF/scheduling-context.xml]: Invocation of init method failed; nested exception is org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'springNonTxDataSource.quartzSchedulerFactoryBeanTarget': java.sql.SQLException: Unable to start the Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: Cannot get Connection from Datasource [See nested exception: java.sql.SQLException: Unable to start the Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: Cannot get Connection from Datasource]]
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:117)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)

    Hi,
    Yes - I changed the password in Oracle DB admin console and jdbc.properties but I still get the same error: ORA-01017.
    The only thing I can think of is that I did not run the encryption java script but to be honest I can't think what diffence this would make.
    Any other suggestions guys?
    Oh the error has now changed slightly
    15:00:54,797 ERROR [ContextLoader] Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'certificationEventListener' defined in ServletContext resource [WEB-INF/idc-context.xml]: Cannot resolve reference to bean 'rbacxIDCService' while setting bean property 'rbacxIDCService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rbacxIDCService' defined in ServletContext resource [WEB-INF/idc-context.xml]: Cannot resolve reference to bean 'rbacxIAMService' while setting bean property 'rbacxIAMService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rbacxIAMService' defined in ServletContext resource [WEB-INF/iam-context.xml]: Cannot create inner bean 'com.vaau.rbacx.iam.service.impl.RbacxIAMServiceImpl#2d09aa' of type [com.vaau.rbacx.iam.service.impl.RbacxIAMServiceImpl] while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.vaau.rbacx.iam.service.impl.RbacxIAMServiceImpl#2d09aa' defined in ServletContext resource [WEB-INF/iam-context.xml]: Cannot resolve reference to bean 'oimSolution' while setting bean property 'iamSolutions' with key [TypedStringValue: value [oracle], target type [null]]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'oimSolution' is defined
    have checked these files and nothing stands out as being wrong.
    Edited by: user8380428 on 09-Dec-2011 07:09

  • HT1040 trying to make an ibook and have 800 photos, want format of 8 photos/page, but default is not that- "create" the initial book from iphoto "album" it loads less than 800 pics and then when i change layout i have blanks.

    trying to make an ibook and have 800 photos, want format of 8 photos/page, but default is not that- "create" the initial book from iphoto "album" it loads less than 800 pics and then when i change layout i have blanks.
    if i clear the book so that it is all blanks and then try to load in the pictures i have it loses the chronology of the pictures that i had established in the album.
    is there a way to import photos into an ibook template and keep the original order of the photos without having to do them one at a time?
    also, is there a way to insert a photo rather than just dragging it? i have tried the cut and paste funciton but it doesn't seem to work, the target site doesn't seem to register with iphoto.
    many thanks for your help.

    Photos are added to book in chronological order.  So if you want to add them to a book in the order you have placed them manually in an album do the following:
    1 - select all the photos in the album.
    2 - use the Photos ➙ Batch Change ➙ Date menu option as shown here. Select any date and add 1 minute between photos.
    3 - select just one photo from the album and create a book from it.
    4 - in the book click on the Options button ➙ Book Settings button and make sure the checkbox for Auto-layout pages is unchecked.
    5 - drag the album with your book photos onto the book icon and they will be imported into the Photos tray of the book in your pre-determined order but not into the pages themselves.
    OT

  • Error creating bean with name 'org.springframework.dao.annotation.Persisten

    Hello
    I am using Hibernate 4, Spring 3 , JSF 2.0 and Weblogic 10.3.6
    When I start weblogic server and server starts successfully, however whenever it starts publishing application, I am getting the following exception.
    Error creating bean with name
    'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0'
      defined in ServletContext resource [/WEB-INF/applicationContext.xml]:
      Initialization of bean failed; nested exception is
      org.springframework.beans.factory.BeanCreationException:
        Caused By: org.springframework.beans.factory.BeanCreationException: Error creating
       bean with name 'entityManagerFactory'defined in ServletContext resource
       [/WEB-INF/applicationContext.xml]: Invocation of init method failed;
       nested exception is java.lang.NoSuchMethodError:
       javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/
       SharedCacheMode;
    Caused By: java.lang.NoSuchMethodError:
    javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()
    Ljavax/persistence /SharedCacheMode;    at
    org.hibernate.ejb.util.LogHelper.logPersistenceUnitInfo(LogHelper.java:38)  at
    org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:525)
    at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)     at  org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManager I have the following in applicationContext.xml
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
        xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-3.0.xsd">     
        <context:component-scan base-package="net.test" />
        <!-- Data Source Declaration -->
        <bean id="DataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
            destroy-method="close">
            <property name="driverClass" value="oracle.jdbc" />
            <property name="jdbcUrl" value="jdbc:oracle:thin:@server:1521:DB" />
            <property name="user" value="scott" />
            <property name="password" value="tiger" />
            <property name="maxPoolSize" value="10" />
            <property name="maxStatements" value="0" />
            <property name="minPoolSize" value="5" />
        </bean>
        <bean
            class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
        <!-- JPA Entity Manager Factory -->
        <bean id="entityManagerFactory"
            class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
            <property name="dataSource" ref="DataSource" />
            <property name="packagesToScan" value="net.test.entity" />
            <property name="jpaVendorAdapter">
                <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                    <property name="showSql" value="true" />
                    <property name="generateDdl" value="false" />
                    <property name="databasePlatform" value="${jdbc.dialectClass}" />
                </bean>
            </property>
        </bean>
        <bean id="defaultLobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" />
        <!-- Session Factory Declaration -->
        <bean id="SessionFactory"
            class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
            <property name="dataSource" ref="DataSource" />
            <property name="annotatedClasses">
                <list>
                    <value>net.test.entity.Department</value>
                    <value>net.test.entity.Employees</value>
                </list>
            </property>
            <property name="hibernateProperties">
                <props>
                    <prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
                    <prop key="hibernate.show_sql">true</prop>
                    <prop key="hibernate.query.factory_class">org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory
                    </prop>
                </props>
            </property>
        </bean>
        <!-- Enable the configuration of transactional behavior based on annotations -->
        <tx:annotation-driven transaction-manager="txManager" />
        <tx:annotation-driven transaction-manager="transactionManager" />
        <!-- Transaction Config -->
        <bean id="txManager"
            class="org.springframework.orm.hibernate4.HibernateTransactionManager">
            <property name="sessionFactory" ref="SessionFactory" />
        </bean>
        <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
            <property name="entityManagerFactory" ref="entityManagerFactory" />
        </bean>
        <context:annotation-config />   
        <bean id="hibernateStatisticsMBean" class="org.hibernate.jmx.StatisticsService">
            <property name="statisticsEnabled" value="true" />
            <property name="sessionFactory" value="#{entityManagerFactory.sessionFactory}" />
        </bean>
        <bean name="ehCacheManagerMBean"
            class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" />
        <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
            <property name="locateExistingServerIfPossible" value="true" />
        </bean>   
        <bean id="jmxExporter" class="org.springframework.jmx.export.MBeanExporter"
            lazy-init="false">
            <property name="server" ref="mbeanServer" />
            <property name="registrationBehaviorName" value="REGISTRATION_REPLACE_EXISTING" />
            <property name="beans">
                <map>
                    <entry key="SpringBeans:name=hibernateStatisticsMBean"
                        value-ref="hibernateStatisticsMBean" />
                    <entry key="SpringBeans:name=ehCacheManagerMBean" value-ref="ehCacheManagerMBean" />
                </map>
            </property>
        </bean>
    </beans>
    pom.xml
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
              http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>net.test</groupId>
        <artifactId>myappp</artifactId>
        <packaging>war</packaging>
        <version>1.0-SNAPSHOT</version>
        <name>myappp</name>
        <url>http://maven.apache.org</url>
        <repositories>
            <repository>
                <id>prime-repo</id>
                <name>PrimeFaces Maven Repository</name>
                <url>http://repository.primefaces.org</url>
                <layout>default</layout>
            </repository>
        </repositories>
        <properties>
            <spring.version>3.1.1.RELEASE</spring.version>
        </properties>
        <dependencies>
            <!-- Spring 3 dependencies -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-tx</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-orm</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <!-- JSF library -->
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-api</artifactId>
                <version>2.1.6</version>
            </dependency>
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-impl</artifactId>
                <version>2.1.6</version>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>jstl</artifactId>
                <version>1.2</version>
            </dependency>
            <!-- Primefaces library -->
            <dependency>
                <groupId>org.primefaces</groupId>
                <artifactId>primefaces</artifactId>
                <version>3.4.2</version>
            </dependency>
            <dependency>
                <groupId>org.primefaces.themes</groupId>
                <artifactId>afterwork</artifactId>
                <version>1.0.8</version>
            </dependency>
            <!-- Hibernate library -->
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>4.1.0.Final</version>
            </dependency>
            <dependency>
                <groupId>javassist</groupId>
                <artifactId>javassist</artifactId>
                <version>3.12.1.GA</version>
            </dependency>
            <dependency>
                <groupId>javax.inject</groupId>
                <artifactId>javax.inject</artifactId>
                <version>1</version>
            </dependency>
            <!-- Oracle Java Connector library -->
            <dependency>
                <groupId>com.oracle</groupId>
                <artifactId>ojdbc6</artifactId>
                <version>11.2.0.3</version>
            </dependency>
            <dependency>
                <groupId>c3p0</groupId>
                <artifactId>c3p0</artifactId>
                <version>0.9.1.2</version>
            </dependency>
            <!-- Log4j library -->
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.16</version>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>6.4</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-jpamodelgen</artifactId>
                <version>1.2.0.Final</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-entitymanager</artifactId>
                <version>4.1.0.Final</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate.javax.persistence</groupId>
                <artifactId>hibernate-jpa-2.0-api</artifactId>
                <version>1.0.1.Final</version>
            </dependency>
            <dependency>
        <groupId>org.apache.myfaces.extensions.cdi.core</groupId>
        <artifactId>myfaces-extcdi-core-api</artifactId>
        <version>1.0.5</version>
        <scope>compile</scope>
    </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-ehcache</artifactId>
                <version>4.0.1.Final</version>
            </dependency>      
        </dependencies>
        <build>
            <resources>
                <resource>
                    <directory>src/main/resources</directory>
                </resource>
            </resources>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>             
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                        <compilerArgument>-proc:none</compilerArgument>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.bsc.maven</groupId>
                    <artifactId>maven-processor-plugin</artifactId>
                    <version>2.0.6</version>
                    <executions>
                        <execution>
                            <id>process</id>
                            <goals>
                                <goal>process</goal>
                            </goals>
                            <phase>generate-sources</phase>
                            <configuration>
                                <!-- source output directory -->
                                <outputDirectory>target/metamodel</outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </project>In Weblogic 10.3.6 I have enabled JPA2 support by adding the following in commEnv.cmd
    @rem Enable JPA 2.0 functionality on WebLogic Server
    set PRE_CLASSPATH=%BEA_HOME%\modules\javax.persistence_1.1.0.0_2-0.jar;
    %BEA_HOME%\modules\com.oracle.jpa2support_1.0.0.0_2-1.jarApplication which works on WLS 10.3.6 is http://download.oracle.com/otn/nt/middleware/11g/wls/1036/wls1036_dev.zip and the one which is not working is
    http://download.oracle.com/otn/nt/middleware/11g/wls/1036/wls1036_win32.exe.
    How can I resolve these errors and exceptions? Any help is highly appreciable.
    Thanks

    Looks like you might have a spelling error in your spring config, or are trying to set a read-only property. BdasInterfaceManagerImpl has been configured as having a method called setBdasInterfaceJdbcDao() : does it?
    By the way, we now know that you're writing code for JP Morgan - there's a slight risk that this could bite you in the @ss at some point (there are some malicious people around) you might want to take that into consideration next time!

  • I want to customize the script that creates ID contact sheets

    I'm using Bridge and InDesign CS3. I just discovered the powerful tool of creating the contact sheets with Bridge. I was wondering if I could edit/customize the script that creates this function.
    I do not want a 1 pt border around my images or caption boxes. Does it use a JSX file and if so which one? I'm on a mac.

    I have added this script into Bridge following the path listed. When I generate an indesign Contact sheet I get an error??
    http://www.twistedjunkie.eclipse.co.uk/images/error.jpg
    not sure whats happening. I need to generate a contact sheet without reducing the image smaller than the A4 page, and without the keyline.
    could someone help
    lister

  • Script to Create databases with params to support dir location for data or log files

    Script to Create databases with params to support dir location for data or log files

    DECLARE @Query VARCHAR(MAX)=''
    DECLARE @DbName VARCHAR(400) = '<DBNAME>'
    DECLARE @DbFilePath VARCHAR(400) = '<Valid DataFilePath>'
    DECLARE @DBLogFilePath VARCHAR(400)='<Valid LogFile Path>'
    SET @Query = @Query + 'CREATE DATABASE '+@DbName +' ON PRIMARY '
    SET @Query = @Query + '( NAME = '''+@DbName +''', FILENAME = '''+@DbFilePath+@DbName +'.mdf'' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) '
    SET @Query = @Query + ' LOG ON '
    SET @Query = @Query + '( NAME = '''+@DbName +'_log'', FILENAME = '''+@DblogFilePath+@DbName +'_log.ldf'' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)'
    print @query
    exec(@query)
    --Prashanth

  • Is there an AppleScript or Automator Script that will wake a Mac from Sleep?

    Is there an AppleScript or Automator Script that will wake a Mac from Sleep?

    Frank and All,
    The following answer to your question above is complicated, but I hope it explains why my question was formed with so much frustration in it.
    I have an OpenOffice(OO) Macro that was launched with Calendar at 6pm each business night. It ran properly in all Apples operating systems until I Hit Maverick(OSX10.9). From then on, the AppleScript would run from one to 3 days, then would disappear from the Calendar entry. The Calendar alert would still run, but the "OpenFile" section of the alert would disappear. I also was running elgato EyeTV HD during the day, so I would use energy saver to put my MacBook Pro to sleep at 12 Midnight and wake it again at 9am. I picked up a used Mac Mini to do the EyeTV stuff, provide AppleTV the files in H264 format through iTunes' media share, and found it had plenty of power to do the 6pm automated stuff simultaneously as well. Because I still wanted to run the OpenOffice Macro on my MacBook Pro at 6pm, and wanted to use it for a host of other things when I was on the road, I wanted it to sleep most of the time and only wake up automatically to run the 6pm OO Macro. When I called Apple about the issue I was having with Maverick and Calendar loosing the OpenFile command as part of the Alert Message, they told me the no longer supported answering AppleScript Questions but they now would support Automator questions. I pointed out that the OpenFile would also fail after one to three days if I used a Calendar Alert to launch an Automator App. At first, I did not like Automator, but now I see why Apple is pushing us to use it. Automator adds a TIME STAMP ID to the Apps developed in Automator so the first time you launch the App after a change to it, you must reply to a dialog message saying that this is the first time you are running this version of the App. If a Scammer has replaced your app with one that can reek havoc on your computer, the replacement app will not run unless you are there to agree that you know where the modified app came from and click the OK button to continue (BRILLIANT, Enhanced Security idea on Apples part). I also noticed that after Mountain Lion, the Applescript delay timing was all screwed up as well. Well I tried to use LaunchD Task Scheduler to circumvent the Calendar Problem and that worked until I upgraded to Yosemite Last week. Then LaunchD no longer worked and I am only into a few days of using The Calendar Launched Automator App to see if it will continue to run.
    But I think I solved the dilemma I was having with opening an Automator App in a Sleeping Mac. I Googled up the following question, "AppleScript to wake up computer".  I went thru several complex responses until I found this on that is INCREDIBLE EASEY! What came back was a brettterpstra.com  response from Feb 20th,2014. What it said, in a Quick Tip: caffeinated your Terminal Article,  if you wanted to wake a Mac from sleep, use the Terminal command named "Caffeine -u -t 1". I placed it in an Automator Most Used Action called "Run Shell Script -- Caffeine -u -t 1" and it worked!  Now, I can put my Mac to Sleep but at 6pm, the Automator App will launch, run the "Caffeine -u- -t 1" command and proceed to work as if I had awakened the Mac From Sleep mode by pressing a keyboard key and had run the Automator Script with a double click.
    Sorry for the long, drawn-out reply, but maybe this will help others.

  • Does anyone have a list of tracks that came free with itunes from the year 2000 onward, from memory they were on the G4 Tower OS install discs?

    Does anyone have a list of tracks that came free with itunes from the year 2000 onward, from memory they were on the G4 Tower OS install discs?

    Does anyone have a list of tracks that came free with itunes from the year 2000 onward, from memory they were on the G4 Tower OS install discs?

  • Problem with SCs that created before the Name Server was configured

    Hello,
    I have created an SC and developed it.
    When I created it, the Name Server wasn't configured and because of that, when I created new DC for this SC I needed to write the vendor manually. Lets assume I wrote example.org.
    Sometime after I did configured the Name Server and I reserved example.org as a namespace prefix.
    When I create new SC and new DCs in it everything is OK: Instead of writing example.org as my vendor I can choose from a combo box between sap.com and my own which is example.org.
    The problem arises with the SC that has been developed before the Name server was configured: If I create new DC for it the vendor is shaded with sap.com inside with no option to change it, even though the previous DCs for this SC were created under the vendor example.org (which I entered manually).
    I assume I can (with a lot of manual work) create new SC and move the DCs (or only their code) to the newly created SC, where I have the option to choose, but I am looking for more simpler solution. For example, changing a certain configuration file at the SC or so.
    Anyone has an idea?
    Thank you in advance,
    Roy

    Anyone...?

  • Needing script to move files with name that starts with

    Here is part of the script that takes a excel file for the list to duplicate files from one folder the another. I would like it to use file name starts with instead exact file name. If I can get this to work I will not have to have a try for .jpg and a seperate try for .eps
                tell application "Finder"
                    try
                        duplicate (sourceFolder & theItem & ".jpg" as string) to destFolder with replacing
                    on error
                        do shell script "echo " & theItem & ">> $HOME/Desktop/NotFound.txt"
                    end try
                    try
                        duplicate (sourceFolder & theItem & ".eps" as string) to destFolder with replacing
                    on error
                        do shell script "echo " & theItem & ">> $HOME/Desktop/NotFound.txt"
                    end try
                end tell
    Thanks

    Ok here is the script that I've been using for a couple of years now with no problems, until I upgraded. Don't know what happened, because I cant even use it on a older system that we have. The error I get is when it tries to get the value of selection from Excel. It times out with no values. Thanks for any help!
    set sourceFolder to choose folder with prompt "Select the folder that contains images to move."
    set destFolder to choose folder with prompt "Select the destination folder"
    if sourceFolder is not destFolder then my moveImageFiles(sourceFolder as string, destFolder)
    on moveImageFiles(sFolder, dFolder)
        script o
            property valuesList : {}
        end script
       tell application "Microsoft Excel" to set o's valuesList to value of the selection
        if class of o's valuesList is not list then return -- not multiple selection
        set tc to (count o's valuesList)
        set dFolder to quoted form of POSIX path of dFolder
        set errorFile to quoted form of POSIX path of (sFolder & "filesNotFound or NotMoved.txt")
        do shell script "/bin/rm " & errorFile & " > /dev/null 2>&1 &" -- remove the error file (if it exists)
        repeat with i from 1 to tc
            repeat with thisValue in (get item i of o's valuesList)
                if contents of thisValue is not "" then -- not a blank cell
                    set tFile to quoted form of POSIX path of (sFolder & thisValue)
                    try
                        do shell script "shopt -s nocaseglob; /bin/mv -f " & tFile & "* " & dFolder
                    end try
                end if
            end repeat
        end repeat   
        do shell script "/usr/bin/open -b com.apple.textedit " & errorFile & " > /dev/null 2>&1 &"
    end moveImageFiles

  • Funky sync? many new groups with names from Notes field created

    I've got a client using Tiger on a G5 iMac, and syncing both with dot mac to a PowerBook, and using PocketMac to a Blackberry (don't get me started about PocketMac and Blackberries.)
    Anyway, I figure a sync caused this: today she opened Address Book and about 50 groups with names taken from her Notes field were there (things like "christmas card"). Some of these groups have cards in them, some don't. We had to restore from a backup. We use Backup, and I hope it's smart enough to take care of the sync stuff in the truth database when the next sync happens. I had Backup do a Restore of the entire ~Library/Application Support/Address Book folder.
    Anybody seen this before? I'd like to prevent it happening again. Also if there are other files that Backup needs to be told to Restore in case this comes up again, I'd appreciate knowing about that, too.
    Thanks!

    By anychance did you or your wife use any forwarding options under mobile me.

  • Is there a way to run a script to create an RPD file from MDS XML files

    We would be interested in using the MDS XML format for the RPD file in saving it in our Subversion source code control system, and I have seen how to do this in the User documentation.
    Our question is whether or not there is a way to use a command line tool to recreate the rpd file without having to use the Admin tool, so that we can automate the deployment of the RPD file from source code control to QA and Production environments.
    If we check in the RPD file directly, then there is a way to automate the process, but we would prefer to use the MDS XML format since this allows us to save changes in text format, not binary, but we still need to be able to automate the process.
    In the Oracle Fusion Middleware XML Schema Reference for Oracle Business Intelligence Enterprise Edition document, I have found that there is a way to automate the creation of the MDS XML files from an RPD file using this command:
    biserverxmlgen -M -R repository_pathname [-P password] -D output_directory [-8] [-N] [-Q|-S]
    So my question is basically is there a way to reverse this process, to use some command line tool (or Weblogic Scripting or some other mechanism) to create the RPD file from the MDS XML files? Are there options on the biserverxmlexec command that will do what I am asking?

    Hey dmfairley,
    Thanks for the question. You can absolutely export the project as .mp3, as outlined in this resource:
    GarageBand Help: Export songs to disk
    http://help.apple.com/garageband/mac/10.0/#gbnd7cbf5ed9
    Export songs to disk
    You can export a project to your computer as a stereo audio file.
    Exported files can be reused in GarageBand to save processing resources by replacing or bypassing multiple regions, instruments, and effects. They can also be used with other music applications and devices, posted on the Internet (on a webpage, or in the iTunes Store, for example), added to an iTunes playlist, or uploaded to a mobile device such as iPhone or iPad.
    1. Choose Share > Export Song to Disk.
    2. To rename the exported file, select the name in the Save As field, then enter a new name.
    3. Choose a location to save the exported file from the Where pop-up menu.
    4. Select the format for the exported file (AAC, MP3, or AIFF).
    5. Choose the quality setting for the exported file from the Quality pop-up menu.
    6. Click Export.
    Thanks,
    Matt M.

  • I want to build an apple script that will parse the name of a file and sort it into folders.

    This is for medical application, so I will do it as such: CLIN_FAM_PAT_FILE_DATE.EXT sorts into Folders: Family/Patient/Type/Date, either sorting into folders that already exist (and make them shared folders eventually for each patient) or creating new folders with names as indicated by the file name.  The Prefix "CLIN" is an indication that the file is a clincial patient document and so needs to be filed.  Files without that prefix would be ignored. 
    So the file format would be:
    Family Folder
    Family DocumentsDocument Type folders
    Patient folders - for each person who is a member of that houshold unitDocument Type Folders (such as x-rays, lab reports, or insurance info)Within each document type, there would be separate folders based on the date (or at least the order of the docs would be by date)
    For example:   A document called CLIN_JONES123_JAMES228_LAB_022614.PDF which is a lab summary for James Jones done on 2/26/14 would go here
    JONES123 FolderJAMES228 FolderLab Results FolderFebruary 2014 Folder.
    Makes sense?  I am initially putting these files into a Filemaker Pro database and having it compile the files based on patient name, type, date, etc.  But need to use Applescript to create the folders so things are organized in a way that I can easily share with patients.
    Makes sense?

    You can call this script from Applescript (just need to do some escaping of quotes):
    This can be run in Applescript:
    do shell script "
    DestinantionFolder=$HOME/Desktop
    MONTHS=(January February March April May June July August September October November December)
    for f in ~/Desktop/*
    do
         if [[ $( echo \"${f##*/}\" | cut -d_ -f1 ) == \"CLIN\" ]] ; then
              ff=$( echo \"${f##*/}\" | cut -d_ -f2 )
              pd=$( echo \"${f##*/}\" | cut -d_ -f3 )
              date=$( echo \"${f##*/}\" | cut -d_ -f5 )
              date=${date%%.*}
              mo=${date:0:2}
              yr=20${date:4:2}
              Dir=$DestinantionFolder/$ff/$pd/${MONTHS[$mo-1]}\\ $yr/
              if [ ! -d \"$Dir\" ]; then
                   mkdir -p \"$Dir\"
              fi
              mv \"$f\" \"$Dir\"
         fi
    done"
    ...is there a way to trigger this whenever a new file is created to check and see if it needs to be moved
    Yes, with Automator.  When you Open Automator, choose Folder Action
    I copied what you did and while the script ran successfully, I don't see any new folders created.  Your shell script makes sense; I am not sure why it doesn't create folders.
    The script as written only looks for files in the Desktop Folder
    (edit by changing: DestinantionFolder=$HOME/Desktop )
    To test I created a file on my Desktop
      touch ~/Desktop/CLIN_JONES123_JAMES228_LAB_022614.PDF
    and Folders were created and the file moved.
    (Note: I only tested that format.  If the file has any other format, it will fail)

  • Create folder with name Client150412n

    Hi,
    I'm new to ApplesScripting. I've found this script that I'd like to change:
    --This script will make a new folder on the desktop with current date and dialog box
    --format the date to 2010-11-19
    tell (current date) to get day & (it's month as integer) & (it's year as integer)
    set TheDateFormat to the result as text
    -- asks for folder name with date as default answer
    set TheFolderName to text returned of (display dialog "Name the folder" default answer TheDateFormat)
    --make folder with date & user entered text
    tell application "Finder"
      make new folder with properties {name:TheFolderName}
    end tell
    The desired changes:
    - Date format should be: 150412 + a letter (a, b, c) if the folder to be created already exists.
    - Place the cursor at the start of name dialog, no selection active.
    - The new folders should be created in /Users/Hans/Dropbox/Jobs/
    Thanks,
    Hans
    Another question is related to execution of the script:
    - How can I start the script easily with a shortcut key or a Dock icon?
    - Is it possible to select client name from a plain text file containing client names in separate lines?
    - Is it possible to have zip files automatically unzipped to subfolder names with the zip package name?
    - Regarding the Dock icon I could even imagine that I drag a zip or other file from an email or the Desktop to the icon and that I only have to type the clients name to have the file moved to a new folder.

    save script as an application bundle.  Drag app to dock.
    Set short-cut key to app.
    AppleScript   Learn AppleScript: The Comprehensive Guide to Scripting and Automation on Mac OS X, Third Edition the book
    AppleScript Language Guide pdf download the pdf file

Maybe you are looking for

  • Apple TV is not connecting to Netflix and is acting buggy.

    After the recent Vimeo update.  I can access iTunes Movies, TV Shows, etc. but I can't sign into iTunes, I get a message saying "Can't sign into iTunes because Apple TV can't get the network time."  Further AppleTV keeps flashing back and forth from

  • Under which group i have to post issues related to SAP - Basis

    Hello All, Can some one tell me Under which group i have to post issues related to SAP - Basis Thanks Balaji

  • Relogin Problem in IR,ID

    Hi all I am facing a weird error here. When i enter username,password to relogin to IR or ID when the connection broke, I am not able to log and i get the following message <i>Unable to connect to server abc:50008. Check server availability Connectio

  • Changing data directly in employee user details / who's who

    Using: EP7, MSAD Hi all, I would like to know whether it is possible to add a modify button within the user details window (who's who) for changing data directly and not to change to a different location within the enterprise portal. if yes, how can

  • HT201210 iOS 7 problems with download and restore on ipad mini

    I downloaded iOS 7 on my ipad mini. When I tried to restore it on iTunes, it says it's extracting my software, but when it's done extracting, it says it can't be restored due to an error. I read troubleshooting page & did updates. Restarted computer