"Can't get folder 'a'" Error with Applescript

Here is my complete applescript application. I am supposed to select a series folder, and it goes into the folder and for each season folder does something inside, including grabbing the name of the season folder. But it keep throwing an error on the line set folderName to name of folder aFolder saying it can't get name of folder "a", but the only folders inside the folder I select are Season 1, Season 2, and Season 3. Additionally, looking at the replies part of the script editor it looks like it does "M" first with no errors, and they goes to "a". I have no idea where this is coming from so help me if you can. Disregard the weird formatting, copying everything from the script editor into here messed everything up. Thanks.
set seriesFolder to (choose folder with prompt "Select TV Series Folder") as text
tell application "Finder" to set tvName to "list of " & (name of folder seriesFolder as text) & " episodes"
openWebpage(tvName)
repeat with aFolder in seriesFolder
  tell application "Finder"
  set folderName to name of folder aFolder
  set whichFile to every file of folder aFolder
  sort whichFile by name
  end tell
  set sNumber to "0" & ((characters -1 thru -1 of folderName) as string)
  set epNum to 1
  repeat with aFile in whichFile
  if epNum is less than 10 then
  set ifZero to "0"
  else
  set ifZero to ""
  end if
  set textBox to "What is episode title for S" & (sNumber as string) & "E" & ifZero & epNum & "?"
  tell application "Finder"
  set filename to name of aFile
  set nameEnding to ((characters -4 thru -1 of filename) as string)
  display dialog textBox default answer ""
  set text_returned to text returned of result
  set name of aFile to "S" & (sNumber as string) & "E" & ifZero & (epNum as string) & " - " & text_returned & nameEnding
  end tell
  set epNum to epNum + 1
  end repeat
end repeat
on openWebpage(input)
  set seriesName to input
  set needle to " "
  set replacement to "+"
  set searchName to search_replace(seriesName, needle, replacement)
  set address to "http://www.en.wikipedia.org/w/index.php?search=" & searchName & "&title=Special%3ASearch&go=Go"
  tell application "Safari" to open location address
end openWebpage
on search_replace(seriesName, needle, replacement)
  set old_delimiters to AppleScript's text item delimiters
  set AppleScript's text item delimiters to needle
  set temp_list to every text item of seriesName
  set AppleScript's text item delimiters to replacement
  set return_value to temp_list as text
  set AppleScript's text item delimiters to old_delimiters
  return return_value
end search_replace

Try replacing the beginning of the script with:
set seriesFolder to (choose folder with prompt "Select TV Series Folder")
tell application "Finder"
set tvName to "list of " & (name of folder seriesFolder as text) & " episodes"
tell me to openWebpage(tvName)
repeat with aFolder in (get folders of seriesFolder)
set folderName to name of aFolder
(109908)

Similar Messages

  • How can I get all users associated with my VSO

    I see here: https://www.visualstudio.com/en-us/integrate/api/shared/profiles that I can get my profile info from the API, but can I get all users associated with an account?

    Hello!
    If you want to see all of that in a single mailbox, you can create a Smart Mailbox from the "file" menu in the top left corner of your screen. It's a bit of trial and error before you get the rules correct, perhaps, but that will work.

  • How can I get the element value with namespace?

    I tried to get a element value in xml has namespace but i can't.
    I removed the namespace, i can get a element value.
    How can i get a element value with namespace?
    --1. Error ----------- xml ------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    *<TaxInvoice xmlns="urn:kr:or:kec:standard:Tax:ReusableAggregateBusinessInformation:1:0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:kr:or:kec:standard:Tax:ReusableAggregateBusinessInformation:1:0 http://www.kec.or.kr/standard/Tax/TaxInvoiceSchemaModule_1.0.xsd">*
    <ExchangedDocument>
    <IssueDateTime>20110810133213</IssueDateTime>
    <ReferencedDocument>
    <ID>318701-0002</ID>
    </ReferencedDocument>
    </ExchangedDocument>
    <TaxInvoiceDocument>
    <IssueID>201106294100</IssueID>
    <TypeCode>0101</TypeCode>
    <IssueDateTime>20110810</IssueDateTime>
    <PurposeCode>02</PurposeCode>
    </TaxInvoiceDocument>
    <TaxInvoiceTradeLineItem>
    <SequenceNumeric>1</SequenceNumeric>
    <InvoiceAmount>200000000</InvoiceAmount>
    <TotalTax>
    <CalculatedAmount>20000000</CalculatedAmount>
    </TotalTax>
    </TaxInvoiceTradeLineItem>
    </TaxInvoice>
    --2. sucess ----------- xml ---------remove namespace---------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <TaxInvoice>
    <ExchangedDocument>
    <IssueDateTime>20110810133213</IssueDateTime>
    <ReferencedDocument>
    <ID>318701-0002</ID>
    </ReferencedDocument>
    </ExchangedDocument>
    <TaxInvoiceDocument>
    <IssueID>201106294100</IssueID>
    <TypeCode>0101</TypeCode>
    <IssueDateTime>20110810</IssueDateTime>
    <PurposeCode>02</PurposeCode>
    </TaxInvoiceDocument>
    <TaxInvoiceTradeLineItem>
    <SequenceNumeric>1</SequenceNumeric>
    <InvoiceAmount>200000000</InvoiceAmount>
    <TotalTax>
    <CalculatedAmount>20000000</CalculatedAmount>
    </TotalTax>
    </TaxInvoiceTradeLineItem>
    </TaxInvoice>
    ---------- program ------------
    procedure insert_table
    l_clob clob,
    wellformed out boolean,
    error out varchar2
    is
    l_parser dbms_xmlparser.Parser;
    xmldoc xmldom.domdocument;
    l_doc dbms_xmldom.DOMDocument;
    l_nl dbms_xmldom.DOMNodeList;
    l_n dbms_xmldom.DOMNode;
    l_root DBMS_XMLDOM.domelement;
    l_node DBMS_XMLDOM.domnode;
    l_node2 DBMS_XMLDOM.domnode;
    l_text DBMS_XMLDOM.DOMTEXT;
    buf VARCHAR2(30000);
    xmlparseerror exception;
    TYPE tab_type is Table of xml_upload%ROWTYPE;
    t_tab tab_type := tab_type();
    pragma exception_init(xmlparseerror, -20100);
    l_node_name varchar2(300);
    begin
    l_parser := dbms_xmlparser.newParser;
    l_doc := DBMS_XMLDOM.newdomdocument;
    dbms_xmlparser.parseClob(l_parser, l_clob);
    l_doc := dbms_xmlparser.getDocument(l_parser);
    l_n := dbms_xmldom.makeNode(l_doc);
    l_nl := dbms_xslprocessor.selectNodes(l_n, '/TaxInvoice/TaxInvoiceDocument');
    FOR cur_tax In 0..dbms_xmldom.getLength(l_nl) - 1 LOOP
    l_n := dbms_xmldom.item(l_nl, cur_tax);
    t_tab.extend;
    t_tab(t_tab.last).ed_id := '5000000';
    dbms_xslprocessor.valueOf(l_n, 'IssueID/text()', t_tab(t_tab.last).tid_issue_id);
    dbms_xslprocessor.valueOf(l_n, 'TypeCode/text()', t_tab(t_tab.last).tid_type_code);
    END LOOP;
    FORALL i IN t_tab.first .. t_tab.last
    INSERT INTO xml_upload VALUES t_tab(i);
    COMMIT;
    dbms_xmldom.freeDocument(l_doc);
    wellformed := true;
    exception
    when xmlparseerror then
    --xmlparser.freeparser(l_parser);
    wellformed := false;
    error := sqlerrm;
    end insert_table;

    l_nl := dbms_xslprocessor.selectNodes(l_n, '/TaxInvoice/TaxInvoiceDocument');try to change as follow
    l_nl := dbms_xslprocessor.selectnodes(l_n,'/TaxInvoice/TaxInvoiceDocument','xmlns="urn:kr:or:kec:standard:Tax:ReusableAggregateBusinessInformation:1:0"');Edited by: AlexAnd on Aug 17, 2011 12:36 AM

  • Can I get a Read Receipt with Mail, like in Outlook?

    Can I get a Read Receipt with Mail, like in Outlook?
    W.W.

    It is possible, though not through the GUI. And as Dave points out, asking for a receipt does not mean that you will get one. The magic incantations for requesting receipts are detailed, amongst other places, in this article. It requires using the Terminal, and once set affects all messages you send until you unset it again.
    If you search this forum for read receipts (the topic surfaces frequently) you should find a helpful Applescript for turning them on and off, to save using the terminal.
    AK

  • I continue to get r6025 runtime error with iTunes version 10.6.3.25.  Have uninstalled and reinstalled twice.  Happens when I search in iTunes Store.  Ideas to fix?

    I continue to get r6025 runtime error with iTunes version 10.6.3.25.  Have uninstalled and reinstalled twice.  Happens when I search in iTunes Store.  Ideas to fix?

    Hi,
    got it fixed! My Son had both files on his Win7 iTunes installation. Never mind he had no issues whith ths iTunes and iPhone Sync. So I checked my other Win XP PC, where I don't have this problem syncing my ipad, and surprise. Both files do NOT show up on this PC. So I renamed the iTunesPhotoProcessor.exe I found under c:\program file\iTunes and synced again my iPhone and it went through without any error. So the problem might be and unremoved iTunesPhotoProcessor.exe or the missing iTunesPhotoProcessor.dll under the iTunes install root folder and this even if I had checked that the folder was completely removed during iTunes unistall.
    Please try yourselve and just rename the iTunesPhotoProcessor.exe to iTunesPhotoProcessor.exe_ under c:\program file\iTunes or get a copy of the missing iTunesPhotoProcessor.dll and cp to c:\program file\iTunes.

  • I get the following errors with CVI 2010. "sal.h"(17​06,15) Redefiniti​on of macro '__null'.

    A project which was working with CVI 9.0 on XP does not compile with CVI 2010.
     I get the following errors with CVI 2010. "sal.h"(1706,15)   Redefinition of macro '__null'.  
    doesnt work with CVI 2010 on on win 7 too.  
    Could some one provide some insight into this please?  
    Thanks
    performance

    You wild guess is correct.
    The version of the Microsoft SDK that shipped with CVI 9.0 included a definition of __null that matched the definition that is in sal.h. You can find this definition in line 448 of CVI90\sdk\include\specstrings.h.
    The version of the Microsoft SDK that shipped with CVI 2010 included a definition of __null that no longer matches the definition that is in sal.h. You can find this definition in line 575 of CVI2010\sdk\include\spectstrings_strict.h. This is why the CVI compiler complains when it finds the sal.h definition.
    The SDK that ships with CVI has been customized to make sure that it works with the CVI compiler. But this does not include making sure that it also works with VC headers. In general, there's no way to guarantee that VC headers can be compiled in CVI, since these headers don't ship with CVI and cannot be customized.
    In this particular case, you might get it work if you include sal.h before you include windows.h. But there are no guarantees.
    Luis

  • Just upgraded to an iPhone 4s but can't get it to sync with my Outlook Calender I have downloaded iCloud but that does not seem to have helped/

    Can anyone help I have just taken an iPhone4s but can't get it to sync with my Outlook calender I have downloaded to my PC the iCloud software but that does not seem to have helped at all?
    Thanks Bazzer50

    Do you see your Outlook calendar on the iCloud website?
    Do you see your iCloud calendar on your iPhone?
    This Apple article is a good place to start -> iCloud: Troubleshooting iCloud Calendar

  • I have a Mac Mini and I can't get it to work with my Ricoh Aficio MP 161.  Any ideas?

    I have a Mac Mini and I can't get it to work with my Ricoh Aficio MP 161.  Any ideas?

    The latest Apple driver support begins with the MP 171.
    Here is Ricoh's official driver download page specifically for the Afico MP 161. Note that new drivers for this device were released on Aug 2, and include Lion and Mountain Lion.
    Hopefully, this will solve your device issues.

  • HT1848 I just downloaded music on my computer but can't get it to synch with my ipad.

    I just download music to my computer, but can't get it to synch with my ipad. Does anyone have a suggestion?

    iOS: Syncing with iTunes - Support - Apple

  • My iPod Classic is seen by Windows but not by iTunes.  I have reset it, gone to disk mode and it won't show up in iTunes.  There appears to be music on it in a file called MUSICSAVE.  How can I get this to work with iTunes again?

    My iPod Classic is seen by Windows but not by iTunes.  I have reset it, gone to disk mode and it won't show up in iTunes.  There appears to be music on it in a file called MUSICSAVE.  How can I get this to work with iTunes again?

    1. Update iTunes to the latest version. Plug in your iPod. If iTunes still can't recognize it, then in iTunes in the top left corner click help> run diagnostics. On the box that comes up, check the last two things. Click next and it should identify your iPod.
    2. Click on your windows start menu. Type in "services". Click on it and when it pops up, on the bottom of it click on "standard". Now Scroll down to find "Apple Mobile Device" Right click it when you see it and click on "Start". When it has started, close iTunes and replug in your iPod and it should show up.
    3. Check the USB cable
    4 Verify that Apple Mobile Device Support is installed
    5. Restart the Apple Mobile Device Service and verify that the Apple Mobile Device USB Driver is installed.
    6. If you just want to add some photos, songs and movies from computer to your devices, you can use an iTunes alternative to do the job
    7. Check for third-party software conflicts.
    <Link Edited By Host>

  • I just replaced my mac pro with an iMac and i can't get it to work with my epson stylus 3800 printer?

    i just replaced my mac pro with an iMac and i can't get it to work with my epson stylus 3800 printer? i have downloaded the 3800 software three times and the imac keeps telling me there is no software to run the printer? Any help here?

    Care to share which OS you are using?

  • How can I get to DFU mode with a broken power button?

    How can I get to DFU mode with a broken power button?

    aarons84 wrote:
    This is bad, but i tried jailbraking my iphone
    You may as well stop there. We can't help you.

  • How can I sync my various email accounts into an iCloud account.  Example.  I have an embarqmail.account.  How can I get it to sync with iPhone, iPad, iMac so that I don't have to read or review eMails on all 3 devices.  Thanks

    How can I sync my various email accounts into an iCloud account.  Example.  I have an embarqmail.account.  How can I get it to sync with iPhone, iPad, iMac so that I don't have to read or review eMails on all 3 devices.  Thanks

    You need OSX 10.7.2 or higher in order to access icloud.  The mobile me account is now defunct (it closed down more than a year ago).

  • How can i get acrobat to work with windows vista

    How can I get adobeexportpdf to work with windows vista?

    But if, on the other hand you do mean Acrobat, please let us know what problem you are having.

  • I rec'd an iPod Nano and can't get it to sync with playlist. I also have Windows 8. I need help!

    I have rec'd an iPod Nano and can't get it to sync with my existing playlist. I am using a Windows 8 Dell laptop. Any suggestions?

    One iCloud account has one user name (a .mac or .me email name) and password.  If you have set up multiple accounts in the past then you must choose one and stay with it.  If you don't know the user name, then you have a problem.  If you haven't really begun using iCloud (but you mention trying to get mail, so I'm assuming you have used iCloud before), then use a .mac or .me account you know you have or just sign up for a new account - and be sure to write down the name and password for future use.
    If you want to use the account to sync your contacts, email, calendars, etc, then each of your ios devices need to use the same account, otherwise they will be independent of one another.

Maybe you are looking for