AppleScript and shell scripts

I'm on Mac OS X 10.11.2 and have problems with AppleScript and shell scripting.

The following script is a cutting of a larger project:

Tell application "Finder".

the value the_MePath (path for me)

the value the_MeCont (the_MePath container) as string

tell the end

the value of the_MeCont (text 1 thru-2) the_MeContShell

-normally isn't here!

the value the_MePara (the_MeCont & "STH - C Para WAV_48k_24.txt")

the value the_Parameters (opening for access file the_MePara with permission to write)

write ("WAV\r24\r48000\r48k\r") the_Parameters

Close access the_Parameters

-normally isn't here!

-destined to be there!

-the value the_MePara (shell script 'find' & city form the_MeContShell POSIX path & "-iname" "Para STH - C *'")

the value the_Parameters (opening for access file the_MePara)

the value the_ParaList (read the the_MePara file)

Close access the_Parameters

paragraph 1 of the value userFormat the_ParaList

paragraph 2 of the the_ParaList the value userBitDepth

paragraph 3 of the the_ParaList the value userSampleRate

paragraph 4 of the the_ParaList the value shortSampleRate

The lines between the "-normally isn't there!"-lines fills a file in the directory of the AppleScript with the data.

So now the file is there.

If I remove these lines and enable the line below "-intended to be here! ', the shell should find this file.

What I get, then, is a mistake:

"Fehler beim Zugriff auf das Netzwerk." error number - 5000 file "/ users/shared/_AppleScript development/_Archiv Sniplets/STH-C Para WAV_48k_24.txt" to "class fsrf".

to "open for access file the_MePara.

Any ideas, anyone?

Kind regards...

... Maik

Hello

Remove the end of file before the_MePara.

the_MePara contains a posix path type path--> "/ users/shared/_AppleScript development/_Archiv Sniplets/STH-C Para WAV_48k_24.txt.

You can use the file on the path of type HFS --> ' StartupDiskName:Users: shared: _AppleScript development: _Archiv Sniplets:STH - C Para WAV_48k_24.txt.

Information:

The script didn't need to open and close the access when the script to read-only.

Use this line only--> the value the_ParaList to read the_MePara

Tags: Mac OS & System Software

Similar Questions

  • Stop the Service Console and shell scripts

    Now that VMware announced ESX 4.1 is their last hypervisor with a service console, I was wondering-

    What are the options to make what is now a large number of Linux shell scripts perform the same functions on ESXi - i.e. PowerCLI, Host Profiles, etc. and how long we have until officially support chips for the ESX service console?

    Thank you

    PowerCLI does not rely on a service console. However, you must have paid the ESXi version for them to work.  With respect to the profiles of the host, which is a characteristic of vCenter and has more no dependencies on the COS.  You can start watching to convert all of your shell scripts PowerCLI and use scripts.

    What about when VMware will stop support for ESX, I do not anticipate happening any time soon.

  • will not appear sql statemnt in shell script

    Hello

    I have a shell script with an unfavourable sql she calls another script where I connect to dabase.

    In the journal of the script, I see the sql statement and I wish that that do not show me anything. How I make these?

    Thank you

    Hello

    2650697 wrote:

    Hello

    I have a shell script with an unfavourable sql she calls another script where I connect to dabase.

    In the journal of the script, I see the sql statement and I wish that that do not show me anything. How I make these?

    Thank you

    Your postal code.  It is very difficult to tell what you're doing wrong without knowing what you are doing.

    You can have SQL statements directly in your shell script.  They must be in a script by themselves, said fubar.sql, and shell script must contain

    @fubar

    instead of real SQL statements.

  • Get the progress and result of a shell script

    Hello

    I would use a shell script to convert MP3 / audio FLAC files MP3 files with a bitrate of 192kbs and do other things in Automator or AppleScript script.

    So I installed lame and flac with brew, run an Automator process with a selected file and perform an action of AppleScrip:

    on run {input, parameters}
    
      if input is not {} then
    
      repeat with theFile in input
    
      set posix_file to POSIX path of theFile
    
      if input is not {} then
    
      tell application "Terminal"
    
      set thescript to "/usr/local/bin/lame -b 192 \"" & posix_file & "\" "
    
      do script thescript
    
      end tell
    
      end if
    
      end repeat
    
      end if
    
      return input
    
    end run
    

    The Terminal window is there because you tell the Terminal to run your script - try using shell script.

  • Insert a record, call a stored procedure and execute a shell script

    Hello

    I am trying to build a page APEX do these three things in order.

    #1. Insert a new record in a database table (pk, donnees_xml, attr1 and attr2, etc.) and download the XML file to the donnees_xml column

    #2. Save this XML file on a file system

    #3. Parse the XML file on a file system and update the database with the parsed data table

    I can do #1 with a regular shape based on the database table. I can do #2 with a stored procedure.

    I can do #3 with a shell script.

    I wonder how these tasks can be combined into a single action in APEX.

    do #1;

    If successful, do #2;

    If successful, do #3;

    I'd appreciate comments on this.

    Thank you

    Define a process of PL/SQL page submit that runs after the record is inserted, if P1_FILE is not null.

  • Call the batch file and not the shell script using measures of the event

    Can I use EVENTACTIONS at the door of gold like

    eventactions (SHELL, /path-to-batch-file/test1.bat)

    will this work? I am on a windows machine, so I need to run a batch file and not a shell script

    In GGSCI, you can shell OUT to the BONE and call a command/executable file.

    For example on Windows:

    GGSCI (WIN2003) 2 > shell dir

    Volume in drive C has no label.

    Volume serial number is 8CCC-9E58

    Directory of C:\ggs

    18/08/2012 07:23

    .

    18/08/2012 07:23

    ...

    2010-10-15 06:37 bcpfmt.tpl 426

    2010-10-15 06:37 bcrypt.txt 1 725

    22/04/2011 03:41 2 560 category.dll

    05/11/2011 10:43

    cfg

    2010-10-15 07:15 739 chkpt_ora_create.sql

    ...

    What were the results when you tried this in an EVENTACTIONS clause?

  • Calling shell script program SQL and passing parameters

    Hi guys,.
    Greetings from Toronto. Is it possible to move one or more strings as parameters to a sql from shell script program?

    Shell script
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
     
    sqlplus.exe -s $p_user_id @$RD_PATH/rd_test.sql $p_user_id $p_job_id
    SQL program (rd_test.sql)
    -- Accept system input parameters
    define p_user_id = &1
    define p_job_id = &2
    
    -- Wondering if its possible to pass these 3 parameters from a shell script program.
    -- (1) rd_test-$p_job_id-3-1.lis
    -- (2) RD_PRINTER(rd_test,3)
    -- (3) t_data
    
    select
    t_data=''rd_test-'||'''$p_job_id'''||'-1-1.txt''
    t_data_dir=''.''
    ksh $RD_PATH/another_shell_prog.sh $p_user_id $p_job_id '||a.rd_value||' '
    ||b.rd_value||' rd_test-$p_job_id-3-1.lis $RD_PRINTER(rd_test,3) '||
    '$t_data $t_data_dir'||'
    exit_status=$?
    check_command'
    from rd_job_parameter b, rd_job_parameter a
    where a.job_id = &2
    and a.jp_module_id = 'RDTEST'
    and b.job_id = a.job_id
    and b.module_id = a.module_id
    /
    As always, this is not something I have to solve that minute. Any help would be appreciated
    and I will think of the problem.

    Thank you
    REDA

    Published by: Raj404261 on June 25, 2009 11:40

    Published by: Raj404261 on June 25, 2009 17:29

    OK, just a few pointers possible if you need to go the way of shell script.

    I suggest that you have a separate SQL script for each of your options, which retains the fairly well-defined lines and keeps the maintenance as simple as possible. Therefore, in your shell script, you can have something like:

    #!/bin/ksh
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
    
    # Deduce which script you'll call here
    # using if statements, or even a case:
    
    if [[ p_job_id -eq 1 ]]
    then
      SQL_SCRIPT=sql_script1.sql
    else
      SQL_SCRIPT=sql_script2.sql
    fi
    
    # Or using case
    
    case $2
      in
        1)     SQL_SCRIPT=sql_script1.sql;
    
        2)     SQL_SCRIPT=sql_script2.sql;
    
        3)     SQL_SCRIPT=sql_script3.sql;
    
        *)     SQL_SCRIPT=sql_script4.sql;
    esac
    
    export ${SQL_SCRIPT}
    
    #If you need to query the database at all to deduce which script to cal
    #Then something like this:
    
    SCRIPT_VAR=`sqlplus -s username/password << EOF
    set heading off
    set feedback off
    set verify off
    SELECT * FROM DUAL;
    EOF`
    
    export {SCRIPT_VAR}
    
    SQL_SCRIPT=sql_script${SCRIPT_VAR}.sql
    
    # Then just call your script:
    sqlplus. -s $p_user_id/password @${SQL_SCRIPT}
    
  • Shell script to monitor and alert DB support TBS space issues

    Hello:

    I am looking to build a shell script which would basically be to connect to the database using tnsnames.ora and check the availability of space on each of the storage space in a database. Send an alert message to dbsupport if it is less then a specified threshold value. Y at - it a script that you can share it with me.

    Kind regards

    BMP

    I would like to know if it works... or if you have any problem... Let me know...

  • Put 'do shell script' multi-line with comments

    I would like to integrate a Bash in Applescript script, as it is on several lines with comments.

    The only documentation useful, that I can find is tn2065, but as far as I can see, it does not say how.

    What is the correct syntax?

    Maybe I'm missing something, but you can just write your script bash as a text object and passing to the shell script:

    game of longBashCommand to "# some relevant comments.

    CD /somedir

    / bin/something - foobar

    # one other comment here

    / bin/Gisèle

    ' # one other comment.

    the shell script longBashCommand

    The trickiest part is perhaps the need to escape some characters such as quotation marks in the command shell.

  • Rotation of the screen with Automator and a script

    I have no knowledge whatsoever about scripts, coding or automator. I continue to read discussions about the issue, but I don't understand them. It would be a great help for me if someone please explain how to create a kind of keyboard shortcut that changed the rotation of the screen (the own macbook screen, not an external) using automator and a script on a Macbook Air running OS X El Capitan 10.11.2.

    Is this possible?

    Thank you in advance.

    One option is to use the utility command line fb - turn in Automator service and assign a keyboard shortcut. Download the GitHub source fb-rotation, compilation, following the indications on GitHub and output the binary to usr; or download a binary compiled and move to usr/local/bin.

    Create an Automator service, set the options "Service receives no entry in any application", add an action to run the Shell Script and set the options as "Shell: / bin/bash ', ' Pass entry: to stdin.  Type the command rotation fb for the desired degree of orientation of the screen such as ' / usr/local/bin/fb-rotation - d 0 - r 180 ' 180 ° on the main screen. Register the service under a name.

    Go to  > System Preferences > keyboard > shortcuts > Services. Highlight the service you created, select it, click "none" and create a shortcut using a unique combination of keys. Create separate services of Automator for the additional screen orientations. Quit the system preferences when you are finished.

    Tested with OS X 10.10.5 Yosemite and El Capitan 10.11.3

  • import program does not process customized when you use the shell script

    Hello

    I have the pkg in that

    PROC1 without leaving param in this procedure, I call you created proc2 import and program

    Now, I call this proc1 in the shell script, here my flat program to import does not work

    Why? and I try to use CONSCUB on proc1 using 2 output param which is errbuf, retcode in the newspaper, I'm "wrong number of arguments"

    Please help me?

    Thank you

    Renon,

    Proc1 is your first program at the same time, right?

    How many parameters is defined for that?

    You can paste a screenshot of the window parameter?

    If there is no parameter, just use this:

    $FND_TOP/bin/CONCSUB $LOGIN SQLAP 'Accounts payable Manager' WAIT ' rajesh' = N SIMULTANEOUS SQLAP PROC1

    Assuming that "Renon" is a username of fnd and the program is set in the Application of accounts payable.

    See you soon

    AJ

  • The work of the Disqualification of Linux Shell Script

    Hello

    We are the 11.1.1.7.3 with Weblogic Web server and Linux App Server Disqualification.

    I want to know how we can carry out the work of the Disqualification of the Linux and write these commands in the shell script.

    (1) present the task (run)

    (2) check the employment status to see if the work is in working condition or supplement

    I know that on Windows, it utility jmxtools.jar of command line operations in dnDirector/Tools folder. But I'm not able to find the jmxtools.jar file in one of the edq.home or edq.local.home of the directories under Linux install.

    Can you guide me to the location where the jmx utility will be available under Linux and also the command to check the status of the job?

    Thank you

    Ravi

    It's him!

    Jobs called via the command line interface return an exit status when finished.

    Monitor the precise status of the long-term work requires the use of the server of the Disqualification Console user interface.

  • Call Shell Script from within PL/SQL - using DBMS_PIPE

    Hi all

    I'm trying to run a shell script inside my PL/SQL using DBMS_PIPE block (not sure if this is the right way or not)

    Pl Sql script

    ==========

    Set serveroutput size 100000

    declare

    cursor c1 is select * from mag_images

    where nom_image like '% comp2.

    v_path varchar2 (100): = ' / home/maguzzi/DOCUMENTS_DIR / ";

    v_result number: = 0;

    v_in_filename varchar2 (100): = v_path | ' test_file.jpg';

    v_out_filename varchar2 (100): = v_path | ' test_file_out.jpg';

    v_script varchar2 (100): = "tst_convert.sh";

    v_command varchar2 (200): = 'sh'. v_path | v_script | » '|| v_in_filename | » '|| v_out_filename;

    Start

    A1 to c1 loop

    dbms_output.put_line ('v_command: ' | v_command);

    write_to_file ('test_file.jpg', 'DOCUMENTS_DIR', a1. Content);

    dbms_output.put_line (' file write result: ' | v_result);

    v_result: = exec_host_command (v_command);

    dbms_output.put_line (' resize result :'|| file v_result);

    end loop;

    end;

    Result DBMS_OUTPUT

    ====================

    v_command: /home/maguzzi/DOCUMENTS_DIR/tst_convert.sh test_file.jpg test_file_out.jpg

    Result of the entry of the file: 0

    Result of resizing the file: 0

    PL/SQL procedure successfully completed.

    Function exec_host_command

    =======================

    FUNCTION to CREATE or REPLACE exec_host_command (lc_cmd IN VARCHAR2)

    RETURN INTEGER IS

    ln_status NUMBER;

    lc_errormsg VARCHAR2 (80);

    lc_pipe_name VARCHAR2 (30);

    BEGIN

    lc_pipe_name: = 'Maguzzi_PIPE ';

    DBMS_PIPE. PACK_MESSAGE (lc_cmd);

    ln_status: = dbms_pipe.send_message (lc_pipe_name);

    RETURN ln_status;

    END;

    /

    The Image of the BLOB is written to the correct location on the server "test_file.jpg", and although the exec_host_command function returns a value of 0, the shell script (tst_convert.sh) is not executed (i.e. no output file is created - outfile.txt and the image is not copied/converted to a new file name "" test_file_out.jpg" )

    Shell script

    ========

    tst_convert.sh

    echo 'Here' > outfile.txt

    Echo $1 > > outfile.txt

    Echo $2 > > outfile.txt

    resizing to convert $1 - $200 2

    Could this be problems with permissions on files?

    test_file1.jpg has permission - rw-rw-r-

    test_convert.sh a permission rwxrwxrwx

    When I run the script manually and pass in 2 parameters ($1 = infilename and $2 = outfilename), it works...

    I'd appreciate if someone can point out my mistake or suggest another method that works.

    Thanks in advance

    How long does it take to create the converted file? Remember that the external Scheduler is running asynchronously, so it is possible that the converted file does not exist yet when the PL/SQL block subsequently tries to open it.

    Try to add some delay seconds to the routine to ensure that the external task is completed:

        begin
          dbms_scheduler.create_job(
              job_name => 'MAG_IMAGE_CONVERT2'
            , job_type => 'EXECUTABLE'
            , job_action => '/home/oracle/DOCUMENTS_DIR/tst_convert2.sh' );--  '/home/oracle/DOCUMENTS_DIR/tst_convert.sh');
          dbms_scheduler.enable('MAG_IMAGE_CONVERT2');
          dbms_lock.sleep(3);
        end;
    

    This probably isn't really a viable solution in the long term if it turns out that this is really the problem.

  • Re: Unix shell script to notify if an array has reached a number of lines

    Looking to write a script to send an alert notification when an Oracle database table object reaches a certain value of line number. If anyone has the logic "If this while" for a script shell unix would be great.

    With the logic of control and check on the table when it reaches the total line number can be added to the script and on-demand via cron.

    Thank you.

    Thus, you must periodically (how often?) a COUNT (*) on the target table?  Is this acceptable overhead?

    /Korn Bourne shell scripts can compare numbers and check if one is greater than another.  See "-gt" UNIX - Shell basic operators

    Hemant K Collette

  • Using the shell script sql variable

    OS: Oracle Linux 5.10

    DB Oracle 11.2.0

    I have need to query the database and assign the return value to a variable of shell, but it does not work.

    create table imr_env (key varchar2(1000), value varchar2(1000) ;
    insert into imr_env values('TblspcUsagePct','90');
    commit;
    

    Here is the shell script:

    #!/bin/bash
    echo "in script"
    ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 ; export ORACLE_HOME
    ORACLE_SID=IMR1 ; export ORACLE_SID
    export PATH=$PATH:$ORACLE_HOME/bin
    
    pct=`sqlplus -S app/manager <<END
           set serveroutput on
           declare
              output_val number ;
           BEGIN
              select value into output_val from imr_env where key = 'TblspcUsagePct' ;
              dbms_output.put_line('output_val: ' || to_char(output_val)) ;
           END ;
           /
           exit;
    END`
    
    ## another sqlplus connection, use $pct in the where clause
    
    echo "var value is $pct"
    
    

    Here is the result:

    SQL> ./test.sh
    in script
    var value is 
    
    output_val: 90
    

    Why isn't the shell variable is populated with the value retrieved from the database?

    I need to use $pct in another query that will be storage spaces that are at least 90% full.

    I had to change to a korn shell - I couldn't get the "READ" command in shell or bash.

    But it is not only "READ" command:

    SQL > select * from IMR_ENV;

    THE KEY VALUE

    ------------------------- -----

    TblspcWarningLimit 90

    TblspcUsagePct 50

    SQL > exit

    Disconnected from the database to Oracle 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    With partitioning, OLAP, Data Mining and Real Application Testing options

    $ cat test.sh

    VAL = $(sqlplus-S test/test)<>

    Set feedback off

    set the position

    Select (value) from imr_env, including the key to_number = "TblspcUsagePct";

    Select (value) from imr_env, including the key to_number = "TblspcWarningLimit";

    "exit";

    EXPRESSIONS OF FOLKLORE

    )

    set $VAL

    Echo $1

    Echo $2

    $./test.sh

    50

    90

    $ echo $SHELL

    / bin/bash

    $

Maybe you are looking for

  • 8.1 Windows Installer Clean

    I did a clean install of windows 8.1 and now I want to install vaio control center for fan control function. But I can't install it. IAM get say an error message: a new version has already been installed on your computer. the installation is stopped.

  • HP Officejet5740: By default, printer Fax

    I installed the HP Officejet5740 all-in-one, and the computer recognizes it as the default printer. However, when I go to print, screen printing to default to a fax.

  • How can I reinstall windows on my AZ3-605

    How can I reinstall windows on my 605 AZ3 please

  • I need help with a problem of file softdub.dll any answers or how to replace it?

    I need help with a problem of file softdub.dll all the answers, or how to replace it?  Yes, it's a problem of Vista vs itunes and apparently I lost? This file somehow.  I have no idea how blessed remedy.  I tried all the normal fixes / easy I know, b

  • C4780 Wireless does not

    Hello I have a hp photosmart C4780, I am trying to connect wireless to. The printer works fine via usb. But after several attempts to connect to my network I have no luck. I tried to reinstall the software on my pc 64-bit windows 7 by ensuring that i