Script works in Script Debugger, but not a folder action - can u help?

Hi
I have written the following script to run as as folder action and it works fine when running it through in debug mode in Script Debugger, but as a folder action nothing happens.
I wonder if someone could have a look and spot what the problem is.
Thanks
Nick
on adding folder items to this_folder after receiving added_items
set convertPath to "Macintosh HD:opt:local:bin:ffmpeg"
tell application "Finder"
set inPath to this_folder as alias
set outPath to this_folder as alias
set filesToConvert to (name of every item of inPath whose name extension is "m4a")
end tell
repeat with i from 1 to count of filesToConvert
set fileName to removeExtension(item i of filesToConvert)
do shell script POSIX path of convertPath & " -i " & (quoted form of ((POSIX path of inPath) & item i of filesToConvert)) & " -f mp3 -ar 44100 -ab 192k -acodec libmp3lame " & (quoted form of (POSIX path of outPath)) & quoted form of (fileName & ".mp3") & " -mapmetadata " & (quoted form of ((POSIX path of inPath) & item i of filesToConvert)) & ":" & (quoted form of (POSIX path of outPath)) & quoted form of (fileName & ".mp3")
end repeat
end adding folder items to
to removeExtension(fileToParse)
#display dialog fileToParse
set prevTIDs to text item delimiters of AppleScript
set text item delimiters of AppleScript to "."
return first text item of fileToParse
set text item delimiters of AppleScript to prevTIDs
end removeExtension

mmh, well, it seems something is awry with the triggering. other folder action scripts seemed to work fine, but now are intermittent.
i created the following simple script:
on adding folder items to this_folder after receiving added_items
display dialog "1"
end adding folder items to
sometimes it works, sometimes not.
what could be going wrong?

Similar Messages

  • Hi, when I download wmv video files, I cannot get any sound. Youtube videos work fine but not wmv files? can somebody help please

    Hi, when I download wmv files on my MacBook Air I cannot get any sound on the videos. Youtube videos work fine but not wmv files. Can anybody help please?

    Install Flip4Mac which allows you to play wmv files.

  • I have a iPhone 4S and when watching videos on the internet sound cuts out as the video is playing. The rest of the video plays with no sound. Sometimes when I pause It and play again sound comes back but not all the time. can anyone help?

    I have a iPhone 4S and when watching videos on the internet sound cuts out as the video is playing. The rest of the video plays with no sound. Sometimes when I pause It and play again sound comes back but not all the time. can anyone help?

    The "restore disk" is built into the Mac. See About Recovery.
    Need more specifics about what error messages you got while installing Adobe Flash.
    However, you can almost avoid Flash altogether by setting YouTube to play the HTML5 version instead.
    Click the Try something new! link at the bottom of the YouTube page.
    I don't know about the sound issue. Might be hardware as you think. Try other headphones to check.

  • I want to change my primary e-mail address that I use with Apple ID - help guide says Select Edit next to "Apple ID and Primary Email Address." But there is no 'edit' on that section there is on every other but not that one. Can anyone help?

    I want to change my primary e-mail address that I use with Apple ID - help guide says Select Edit next to “Apple ID and Primary Email Address.” But there is no 'edit' on that section there is on every other but not that one. Can anyone help?

    You can create an alias @icloud.com email address within your current account that will receive email in your current iCloud inbox (see http://help.apple.com/icloud/#/mm6b1a490a).  (@me.com addresses are no longer available as new addresses.)  Just be aware that you cannot use an alias address later to create a new iCloud account or move it to a different account.
    Also, even if you created a new iCloud account with a new ID, your existing purchases would not be lost.  They are permanently tied to the original ID you used to purchase them.  You can also continue to use the existing ID for the iTunes store; it does not need to be the same as the ID you use for iCloud.

  • Short, basic VB script works on 2003 Server but not on 2012 R2 server

    Hello all,
    Hopefully I'm posting this in the right place. I have a legacy VB script that I need to keep, but I'm having trouble getting it to work on Server 2012 R2.
    The script reads a file called "Test.txt" that contains the following string:
    String1|String2
    Part of the VB script is to read this "Test.txt" file and parse this line into 2 separate elements based upon the "|" delimeter:
    On Error Resume Next
    Dim FSI, inputFile, String, f, WshShell,WshNetwork, WshFSO, StringArray
    inputFile = "Test.txt"
    CONST ForReading = 1, ForWriting = 2, ForAppending = 8
    Set FSI = CreateObject("Scripting.FileSystemObject")
    Set f = FSI.OpenTextFile(inputFile, ForReading, True)
    Set WshShell=WScript.CreateObject("WScript.Shell")
    '********* Read the file ********
    String = f.ReadLine
    msgbox("String: "&string)
    '********* Split the line *******
    StringArray = Split(String,"|", -1, 1)
    msgbox("stringarray(0): "&stringarray(0))
    msgbox("stringarray(1): "&stringarray(1))
    The variables in this script when ran on Server 2003 are:
    string = String1|String2
    stringarray(0) = String1
    stringarray(1) = String2
    So this script parses the String1|String2 line perfectly on Server 2003. However, running this same VB script on Server 2012 R2 results in very strange output:
    The variables in this script when ran on Server 2012 R2 are:
    string = ӱƥt
    stringarray(0) = ӱƥt
    stringarray(1) =
    Is there anything on Server 2012 R2 that I need to install to get this to work in VB, or what is the issue with Server 2012 R2 and visual basic? I'd LOVE to redo this in PowerShell but I need to keep it Visual Basic for legacy reasons for a few more months.

    Hmm interesting. I tried using the 3 different "format" parameters for the OpenTextFile method, and none of them worked on Server 2012 R2:
    http://msdn.microsoft.com/en-us/library/aa265347(v=vs.60).aspx
    However, I copied the text file directly from the 2003 server and placed it on the 2012 R2 server, and then the script worked great!
    Thanks for steering me in the right direction Bill!

  • Script works for one frame but not another

    I set up 2 keyframes, each one loads a different text file
    into a dynamic text box. The text box for the first keyframe is
    named "session" and the text box for the second keyframe is named
    "oneptq". The text file for the first text box is named Titles.txt
    and the text file for the second keyframe is 100Q.txt. The code I'm
    using is identical (except for the respective names of the text
    boxes and text files) but for some reason the text will load in the
    first text box but not the second.
    Here's my AS for the first keyframe:
    lvLoader = new LoadVars();
    lvLoader.onLoad = function(success)
    if(success)
    session.text = lvLoader.textbody;
    lvLoader.load("Titles.txt");
    And my AS for the second keyframe:
    lvLoader = new LoadVars();
    lvLoader.onLoad = function(success)
    if(success)
    oneptq.text = lvLoader.textbody;
    lvLoader.load("100Q.txt");
    I can't figure this thing out. Please help. Thanks.

    Have you double checked that it's a DYNAMIC text box? Maybe
    it was accidentally swapped by to static at some point...

  • IPOD recognized by windows but not updater...can someone help me?

    Hi all,
    Any help would be greatly appreciated on this one.
    My IPOD's old hard drive (10G) went kaput and I bought a new one (the new HD is 15G). I installed the new one and now windows is recognizing the IPOD as an external hard drive but not as an IPOD.
    The IPOD is a 3rd generation, 15 gig IPOD without the dock connector.
    I am guessing that this is linked to why the IPOD updater won't recognize the IPOD either.
    Does anyone have any device for me?
    Again, thanks for taking the time to help out!!

    You could try a format of the iPod in Windows. A full format does a check and remap of bad sectors on the iPod hard drive, and you would need to restore the iPod as normal (using the iPod updater) afterward. This can also work when the iPod is recognized by the computer, but not by the updater.
    First, put the iPod into forced disk mode.
    See: How to put the iPod into disk mode.
    On your PC, go "my computer" and right click on the iPod, then choose "format". Ensure the settings are at "default" and that "quick format" is not checked. Now select "format". It will take a while, but when that's finished, restore the iPod using the updater.
    If you need to, reset the iPod to exit disk mode.

  • Simple Script works on 10.6 but not 10.5.8

    Hi,
    Brand new to Applescript...I made a simple script (saved as an application) to rename Excel Sheet Tabs and it works on my MBP (10.6.2) however when I try sharing with other users (10.5.8), it fails to carry out properly. It opens a blank workbook rather than the "test.xls" workbook and won't go any further. Am thinking it might be due to:
    1) where the script and .xls file were originally created/saved?
    2) 10.6.2 vs. 10.5.8?
    3) method of sharing? Tried attaching to Mac OSX Server Wiki, NAS and e-mailing but still wouldn't work.
    here's the script-
    tell application "Microsoft Excel"
    try
    open workbook workbook file name "test.xls"
    activate object worksheet "names"
    set myRange to range "A2" of worksheet "names"
    set myName to input box prompt "Please type a Student Name" title "Students"
    set value of myRange to myName
    set name of sheet 3 to myName
    set myRange to range "A3" of worksheet "names"
    set myName to input box prompt "Please type a Student Name" title "Students"
    set value of myRange to myName
    set name of sheet 4 to myName
    set myRange to range "A4" of worksheet "names"
    set myName to input box prompt "Please type a Student Name" title "Students"
    set value of myRange to myName
    set name of sheet 5 to myName
    set myRange to range "A5" of worksheet "names"
    set myName to input box prompt "Please type a Student Name" title "Students"
    set value of myRange to myName
    set name of sheet 6 to myName
    set myRange to range "A6" of worksheet "names"
    set myName to input box prompt "Please type a Student Name" title "Students"
    set value of myRange to myName
    set name of sheet 7 to myName
    set myRange to range "A7" of worksheet "names"
    set myName to input box prompt "Please type a Student Name" title "Students"
    set value of myRange to myName
    set name of sheet 8 to myName
    set myRange to range "A8" of worksheet "names"
    set myName to input box prompt "Please type a Student Name" title "Students"
    set value of myRange to myName
    set name of sheet 9 to myName
    set myRange to range "A9" of worksheet "names"
    set myName to input box prompt "Please type a Student Name" title "Students"
    set value of myRange to myName
    set name of sheet 10 to myName
    set myRange to range "A10" of worksheet "names"
    set myName to input box prompt "Please type a Student Name" title "Students"
    set value of myRange to myName
    set name of sheet 11 to myName
    set myRange to range "A11" of worksheet "names"
    set myName to input box prompt "Please type a Student Name" title "Students"
    set value of myRange to myName
    set name of sheet 12 to myName
    end try
    end tell
    Any suggestions will be greatly appreciated! THANKS!

    more info:
    a co-worker with a MacBook (10.5.8) was able to download the script and .xls file from our server and it worked...
    An eMac (10.4.11) was not able to run the script.
    All machines are running 2008 Office for Mac

  • PHP Script works in Chrome, IE9 but not in Firefox 15

    This page is a PHP script for creating hyperlinks to all files in a directory:
    http://www.checktheevidence.co.uk/audio/index.php?dir=&sort=date&order=desc
    It works fine in IE9 and Chrome, but Firefox "give up" about 3/4 way down the listing the hyperlinks for the files are no longer shown. Weird stuff.
    This issue has been present for a long time

    It's not pretty, is it. The problem is that your page opens <strong> tags without closing them. For example:
    <div>
    &lt;a href="Victoria Derbyshire Cuts off Police Constable talking about The Club in the Police - Radio 5 Live - 13 Sep 2012.mp3" class="w"><b>&lt;strong></b>Victoria Derbyshire Cuts off Police Constable talking about The Club in the Police - Radio 5 Live - 13 Sep 2012.mp3 &lt;/a>
    (1.5 MB) (Modified: Sep 17 2012 11:06:37 PM)
    &lt;/div>
    This causes Firefox to "nest" tags in the page past a maximum depth. After that point, it just dumps text to the page. Similar/related past threads:
    * [https://support.mozilla.org/en-US/questions/846246 Part way through a particular web page, HTML stops being rendered]
    * [https://support.mozilla.org/en-US/questions/929969 text is missing from webpage]
    So just a small fix to your PHP and you should be good to go.

  • SQL script works in SQL Developer but not when scheduled

    I have a script that I can run, logged onto my server as a user with full permissions and into my database as SYSDBA, that produces a CSV file on the server when I run it from SQL Developer ON the server. HOWEVER, when I set it up as a scheduled job, using those SAME CREDENTIALS (same Windows/network user; same database user), I get no output. The job indicates that it's running successfully, but no file gets created.
    Any advice is greatly appreciated.
    Here's the script:
    WHENEVER SQLERROR EXIT FAILURE;
         set serveroutput on
         DECLARE
         my_query varchar2(5000);
         BEGIN
         my_query := q'[
    SELECT client_id, JOB_NAME, SCHEDULE_TYPE, TO_CHAR(START_DATE,'MM/DD/YYYY HH24:MM') AS START_DATE,
    REPEAT_INTERVAL, ENABLED, STATE, RUN_COUNT,
    TO_CHAR(LAST_START_DATE,'MM/DD/YYYY HH24:MM') AS LAST_START, LAST_RUN_DURATION,
    TO_CHAR(NEXT_RUN_DATE,'MM/DD/YYYY HH24:MM') AS NEXT_RUN
    FROM DBA_SCHEDULER_JOBS
    WHERE instr(client_id,'10.') is not null
    ORDER BY LAST_START_DATE DESC
         p2k.ccsd_any_query_to_csv('HRISEDB_E_OUTPUT_MK', 'dbserver_job_output.csv',my_query);
         end;
    =================================================================
    Here's the called procedure (I don't really understand it -- I gleaned it from others on the internet):
    -- DDL for Procedure CCSD_ANY_QUERY_TO_CSV
    set define off;
    CREATE OR REPLACE PROCEDURE "CCSD_ANY_QUERY_TO_CSV" (p_dir in varchar2, p_filename in varchar2, p_query in varchar2) AUTHID CURRENT_USER
    is
    l_output utl_file.file_type;
    l_theCursor integer default dbms_sql.open_cursor;
    l_columnValue varchar2(4000);
    l_status integer;
    l_query long;
    l_colCnt number := 0;
    l_separator varchar2(1);
    l_col_desc dbms_sql.desc_tab;
    l_col_type varchar2(30);
    l_datevar varchar2(8);
    BEGIN
    l_query := 'SELECT SYSDATE FROM DUAL; ';
    dbms_sql.parse(l_theCursor, p_query, dbms_sql.native);
    dbms_sql.describe_columns(l_theCursor, l_colCnt, l_col_desc);
    l_output := utl_file.fopen( p_dir, p_filename, 'w' );
    dbms_sql.parse( l_theCursor, p_query, dbms_sql.native );
    for i in 1..l_col_desc.count LOOP
    utl_file.put( l_output, l_separator || '"' || l_col_desc(i).col_name || '"' );
    dbms_sql.define_column( l_theCursor, i, l_columnValue, 4000 );
    l_separator := ',';
    end loop;
    utl_file.new_line( l_output );
    l_status := dbms_sql.execute(l_theCursor);
    while ( dbms_sql.fetch_rows(l_theCursor) > 0 ) loop
    l_separator := '';
    for i in 1 .. l_colCnt loop
    dbms_sql.column_value( l_theCursor, i, l_columnValue );
    utl_file.put( l_output, l_separator || '"' || l_columnValue || '"');
    l_separator := ',';
    end loop;
    utl_file.new_line( l_output );
    end loop;
    dbms_sql.close_cursor(l_theCursor);
    utl_file.fclose( l_output );
    execute immediate 'alter session set nls_date_format=''dd-MON-yy'' ';
    exception
    when others then
    execute immediate 'alter session set nls_date_format=''dd-MON-yy'' ';
    raise;
    end;
    /

    hello,
    does oracle showing any errors in user_scheduler_job_run_details for this job ? I would advise try inserting some debug statement to identify where exactly its stuck. Also please check sample configurations syntax for user_scheduler_jobs.
    Cheers
    Sush

  • Scroll script works in Flash 6, but not in 9

    I have a simple scroller script that works fine for scrolling
    a movieclip in Flash 6, but when I publish in anything later, it no
    longer scrolls. Both are set to AS2. Is there an obvious reason
    that anyone can see of why this should be? When I test the script
    syntax in the actions panel, it says there are no errors in the
    script. By tracing I can see that there's no trouble with targeting
    the up and down buttons or scroll slider, and the slider still
    drags, but the content MC doesn't move as it should. Thank you very
    much for your help, in advance. Here's the script, in case the
    answer isn't obvious from the description:

    You were right! It works now, even as posted above. I just
    remembered I had fixed an upper/lower case inconsistency just for
    neatness since I last tested, never thinking that would fix the
    problem! I just tested again and to my surprise, it works great. I
    guess neatness does count!!! Thanks again, kglad!

  • Script works in PowerShell ISE but not in regular PowerShell window

    Hello all!
    I've got another PS conundrum to ponder.  I have the following script lines:
    write-host"Check
    for password complexity requirements:"-foregroundcolorblack-backgroundcolorwhite
    write-host""
    import-moduleactivedirectory
    $PasswordPolicy=Get-ADObject$RootDSE.defaultNamingContext
    -PropertypwdProperties
    $PasswordPolicy|Select@{n="PolicyType";e={"Password"}},`
    DistinguishedName,`
    @{n
    ="Password complexity requirements";e={Switch($_.pwdProperties)
    0{"Passwords
    can be simple and the administrator account cannot be locked out"} 
    1{"Passwords
    must be complex and the administrator account cannot be locked out"} 
    8{"Passwords
    can be simple, and the administrator account can be locked out"} 
    9{"Passwords
    must be complex, and the administrator account can be locked out"} 
    Default{$_.pwdProperties}}}}
    |ft*-auto
    When I run this code in ISE, it works great.  It returns the value for the setting "1" which is what this GPO is set to.
    But, when I run this same code in elevated PowerShell prompt, I get the following error:
    Any help would be greatly appreciated.

    Hi,
    Are you creating $RootDSE before you use it?
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Script works fine in CC but not CS5- Any tips?

    So i have this script that detects instances of XXXXXXXX and turns them into hyperlinks. It works fine in InDesign CC however won't play nice in CS5.
    Anyone have any tips as to how I can go about making it work?
    var myDoc = app.activeDocument;
    var myLinkStyle = myDoc.characterStyles.itemByName("link"); // the Character style of the links
    var myURL = "http://www.abc.com.au/part/{part_id}?utm_source=ABC%PublicationName&utm_medium=Catalogue&utm_term={part_id}&utm_campa ign=Catalogue"; // url of your company
    var myUrlPartReplace = new RegExp("{part_id}", 'g');
    var i, myLinks, myLink, mySource, myDestination;
    for (i = myDoc.hyperlinkTextSources.length-1; i >= 0; i--){
        mySource =  myDoc.hyperlinkTextSources[i];
        if (mySource.sourceText.appliedCharacterStyle == myLinkStyle){
            mySource.remove(); // removes existing hyperlinks to avoid "double bookings"
    app.findGrepPreferences = null;
    app.findGrepPreferences.findWhat = "\\<(\\d\\d\\d\\d\\d\\d\\d\\d)\\>";
    myLinks = myDoc.findGrep();
    app.findGrepPreferences = null;
    for (i = 0; i < myLinks.length; i++){
       myLink = myLinks[i];
       mySource = myDoc.hyperlinkTextSources.add(myLink);
       myDestination = myDoc.hyperlinkURLDestinations.add(myURL.replace(myUrlPartReplace, myLink.contents.replace(" ", "")));
       myDoc.hyperlinks.add(mySource, myDestination);
    Thanks in advance!

    HI Trevor,
    Thanks for the suggestion. I copied the script into a new file and tried to run from the ESTK... no luck (see screenshot).

  • Script works in one frame, but not with frames before it

    Hi all-
    I'm a complete AS/Flash n00b, but hoping that I can get some guidance on this.
    I'm trying to test a very simple function for an e-learning module that is to train people on using 'quick keys' or key combinations on their keyboard. Basically, I want to show them a command and have them practice. In the practice, they will be asked to use a command and then have to do it on their keyboard.
    I used the code below successfully with one frame and a couple layers. I created a text-area ("traceArea), put it on the stage, set up the event and function... it works great! (although I'm sure the code isn't very pretty) When anything other than ctrl-p is pressed, it traces the "Try again!" message and when ctrl-p is pressed, "Great job!" pops up.
    stop();
    stage.addEventListener(KeyboardEvent.KEY_DOWN, detectKey);
    function detectKey(event:KeyboardEvent):void
    if (event.ctrlKey== true && event.keyCode==80 )
    traceArea.text = "Great job!";
    else
    traceArea.text = "Try again!";
    So, then I tried to build on to the file and added two frames before the previous AS code.
    Frame 1 - Intro
    A short introduction to the 'module' with a continue button. The code for this frame is:
    stop();
    continueBtn1.addEventListener(MouseEvent.MOUSE_UP,buttonPressed);
    function buttonPressed(event:MouseEvent)
    nextFrame();
    Frame 2 - Instructions
    This frame shows the viewer the correct keys to use to print (ctrl-p). There is another continue button here. Code:
    stop();
    continueBtn2.addEventListener(MouseEvent.MOUSE_UP,buttonPressed);
    The last frame is then the 'practice' (see first code above).
    When I run this file, there are no errors, but when it gets to that last frame, nothing is traced and there is no output on any keyboard command. I know the solution must be pretty easy, but I'm missing it and have no idea what it might be!
    Any help is appreciated. Thanks!
    -Andy

    use the trace function to debug your flash code:
    stop();
    stage.addEventListener(KeyboardEvent.KEY_DOWN, detectKey);
    function detectKey(event:KeyboardEvent):void
    trace(event);
    if (event.ctrlKey== true && event.keyCode==80 )
    traceArea.text = "Great job!";
    else
    traceArea.text = "Try again!";

  • Me edge animate project works when I test, but not when I publish. Please help.

    I feel like this has happened to me in the past, but I just cannot get the thing to work when I post it online. It's just a blank page, all white. I think there might be something in the code of one of the .js files that I need to change.
    ??  I saw something about the phrase 'use strict' but I can't find that code anywhere.
    There must be something I'm forgetting. I put all of the published files up on the server, and I just can't access it. Any help would be seriously appreciated.
    Thanks.

    Can you share the website link so that we can see what the issue is?
    Regards,
    Vivekuma

Maybe you are looking for

  • I am trying to connect an airport extreme to extend my wifi coverage and it doesn't work

    I hope someone can help me. I have an Apple Airport extreme gen 5.  I have a BT router/modem that I connect to my broadband and its signal is OK but not great.  I have multiple apple devices, a windows PC, and a Panasonic smart TV. I also use Belkin

  • M40X: Wireless stopped working

    Hi everyone Please can anyone help. My wireless conection has just stopped working. I have a M40x Toshiba laptop, a belkin g router (F5D7231uk4) and my sevice provider is NTL. I've checked with NTL and all is fine. I've taken the cable that runs from

  • Reading an invocation payload from BPEL

    Hi, I was wondering if anyone had successfully managed to read an XML payload from the BPEL dehydration store? I have a requirement to replay 4hrs of messages from BPEL in the event of a catastrophic failure on a subscribing system. I can't find any

  • Avoid displaying duplicates records?

    I have the following query to display records from two tables: select * from COLLATERAL CL, COLLATERAL_REF CF where CF.ACCOUNT_NUMBER like '1000000001%' AND CF.COLLATERAL_ID=CL.COLLATERAL_ID How do i change this query to avoid duplicate collateral_id

  • I want to update my Ipod.

    I want to update my Ipod touch. But it says I need to move all the files from it to my itunes on my laptop. How do I do that?