Script no longer works when I remove beep

I am trying to create a script that will get the number of words in a Pages document, and then save in a Numbers spreadsheet. I am a novice coder and until about 6 hours ago, I got this script, I had never even heard of Applescript. But with trial and error, I came up with this script to display the number of words in my document:

say application 'Finder '.

activate

Set myFile to alias "user: boldfish98:Desktop:Aviator alias.

myFile Open

beep

say application 'Pages '.

          tell front document

say text body

the value myCount to count words

               end say

          end say

          close front document

     end say

end say

myCount

(I posted only myCount to make sure it works, ultimately, it will not display). This script was working fine so I started on the part that would put the number of words in the worksheet. I have made good progress on this front, I noticed a really annoying problem with the above code. When I was working on this part I put a bunch of beeps at different points that I would like to know when the code stopped working. I deleted most of them, once I knew that the code worked and I was ready to move on to the next part. But when I tried to delete one of the beeps (the only one left in the code that I put in this post), the script no longer works. I get this error in script, emphasizing "word count":

Pages has been an error: failed to get document 1. Invalid index.

It did not make sense to me so I checked over and over again to make sure that I had not deleted anything else, but it was just the beep. When I put the beep back in at exactly the same place the script developed, when I pulled it again I got the error. Even with my extremely limited experience I am sure that something is wrong and my coding script should not to beep to run. I looked through the internet to see if anyone else has had this problem and found nothing, so I started to browse all the posts here the applescript, and I saw someone ask if error a poster that's happened on the compiling or running. I know type of compilation of what means but I do not know how it is applied to the script editor. I guess this is what happens when I press on save and the light purple text gets formatted with 'say' in "BOLD", "application" in Blue italic and so on. I don't get the error, then, it happens when I run. Sometimes when I run the script with the beep I always get the message, so I think that there could be something wrong with the way I count the words (if you know it please report it), happened only 5% of the time that I run with beep. And it happens 100% of the time when beeping is not there.

Here are the things I've tried (none of them worked):

-copy and paste the code without the beep in a new document from the script editor

-Retype the code without the beep in a new document from the script editor (I got the same error but when I added in the beep it worked)

-restart script editor and pages

-restarting my laptop

-Commenting on the beep

-replacement of tone with screen of dialogue ("Hello world!")     the dialog box display worked, but after I clicked OK in the dialog box the script stopped running, and I got the same error

-remove the beep and but leaving empty line

-remove the beep and the empty line

-change slightly the other parts of the code as a substitute "document before closing" by "quit".

a lot of these I didn't work, I was just desperate. I also didn't expect the success of my script a beep. I feel like script editor knows I'm brand new to this and so he's trying to trick me. Any help would be greatly appreciated. And if you know other ways I could improve this code, I'm all ears. Thank you!

Also I just got this new laptop as a week ago, so I don't think that this problem is related to my software is obsolete.

When I tried cela it is line 3 that caused the problem; It should read

value alias myFile "alias Users:boldfish98:Desktop:Aviator.pages".

As you, it did not work even with the beep; with this change, he worked with and without the beep. Other than that, "beep" takes back you to the inventor, but I don't see why that should be a problem.

Tags: Mac OS & System Software

Similar Questions

  • APEX 5, interactive report remove 'Control Panel' script no longer works

    I'm trying to hide (remove) interactive report 'Control Panel' captured below so that users cannot change the report either.

    I found this thread here.

    https://community.oracle.com/thread/3686632

    Remove the interactive report 'Control Panel' script no longer works

    I tried #1 and #2. The two does not work in 5 APEX.

    By #3, I'm not sure that I put the code in the right place. But I loved not below, and it does not work.

    Can someone help me hide from opening the page control panel?

    1. in the footer

    < script type = "text/javascript" >

    $x_Hide ('apexir_CONTROL_PANEL');

    < /script >

    2 (page inline css section)

    Table #apexir_CONTROL_PANEL {display: none ;}}

    3 to implement a dynamic action on the page to hide the control panel at help:. this.affectedElements.find hide() (".to-IRR-controlsContainer"); the loading of the page.

    Kiran Pawar says:

    Hi JonDaegu-Oracle,

    JonDaegu-Oracle wrote:

    I open this IRR with this url a bit of a wiki page and I want to open this IRR without any user input and make it look like a page static as much as possible.

    .../f?p=200:21:0::no:CIR:IREQ_RELEASE,IREQ_PLATFORM:11.2.0.4,Linux:Yes

    And I tried your solution and it does not work yet. Am I missing something here?

    Set your static region ID like IR: customer_ir

    Ah. The ID attribute is dynamic. It was a busy day.

    It make much sense to do so if the IR has nothing to do with customers. Probably a better idea to use a more generic selector (assuming that there is of course no other IRs on the page):

    .a-IRR-controlsContainer {
      display: none;
    }
    
  • Scripts no longer works via the bridge

    For some reason scripts no longer works in Bridge CS4.

    I previously installed scripts "of Dr. Brown's services" which is available in the menu 'Tools' of the bridge. However, when I select some files, then choose this script for Photoshop to start, but nothing more happens.

    Is the same for the 'tools'-'Photoshop' menu (lot, processor Image etc.). Photoshop CS4 starts but nothing else happens.

    However, if I do the same thing in Photoshop itself ('file'-'Scripts') it works fine, so the scripts themselves are working, or so it seems.

    If for some reason suddenly fill other behaviors then before the first

    thing to try is a reboot for bridge by pressing the option key refresh the

    preferences. Give the Prefs to your wishes and try again.

    For some reason scripts no longer works in Bridge CS4.

  • In the latest Version of FireFox 9 Page Starup of Mozilla Firefox, pls which is the default home page no longer works, when you click it says invalid link, look at this and fix it...

    In the latest Version of FireFox 9 Page Starup of Mozilla Firefox, pls which is the default home page no longer works, when you click it says invalid link, look at this and fix it...

    Can be caused by a corrupt installation of Visual C++ (several versions can be installed-by-side; SxS) it lacks certain runtime components (Redistributable Package).

    See:

  • my iphone 5 c screen stops working when I remove the case

    my iphone 5 c screen stops working when I remove the case

    Delete this case? Please explain what you ask a little more clear.

  • Bluetooth mouse no longer works and cannot remove a device.

    1 week old Bluetooth mouse suddenly stopped working with my laptop.  Until someone said, yes I checked the batteries and I've used it with another PC, the mouse is not the problem.

    in any case, I tried to plug it into my laptop several times and not the laptop cannot find it.  To frustrate me more, Windows 8 won't let me delete my mouse as a device (I wanted to try and plug it back again from scratch).  Just comes up with a message "cannot delete device '.  I tried several times.
    I think as long as I can remove the mouse like device, I should be able to connect successfully... Any help or advice?

    Hey guys I looked for a solution for 'my Bluetooth device is connection and disconnection or my Bluetooth device disconnects and removed t' a week ago and finally painting things worked well

    FIRST PROBLEM

    1 - Here's what you can do in windows 8 and the problem is that your machine can t be removed:

    1 - Go to "Control Panel" and then type "Device Manager" and then the "double click on"Device Manager"

    2-u'll find a long list, probably you won t find the icon "Bluetooth" word on it, then you will need to click on 'view' in the top left of the window and choose "see the hidden devices" after that you will notice that the word Bluetooth is appeared in the list, double-click the new list all appears but it'll not be in bold in this new list under Bluetooth search title for the name of the device you use, like hp Bluetooth mouse or mouse Logitech Bluetooth or headset or things like that, your product you have attached and does not not must be in the list below Bluetooth option search anyway then it uninstall and then close all the control panel and sub windows of it , then go to "Devices" at the top right 1 class 2 - click pc settings 3-change 4-devices choose

    5. If you find the device it uninstall and it'll be uninstalled with success or u can not find more on your list of devices

    then restart your computer and you can associate your device successfully in 'Add a device option' in your page "devices."

    but w8 is not completed yet, you must do things more :) to avoid this problem from happening again:

    1. open "Device Manager" this time you will find Bluetooth option when you open it without doing anything, so you double-click it, the list will open fat this time in one of the option you'll find adapter 'word' at the end of one of the s long option name click this title of void, you will find some title in one of the name of titles there are "Power management."  Uncheck the options that are probably ticked then click 'ok' and then pair your Bluetooth, this time it should work correctly.

    Problem 2 seconds if you experience a problem where the your Bluetooth device's connection and disconnection periodically by itself:

    1. open "Device Manager" this time you will find Bluetooth option when you open it without doing anything, so you double-click it, the list will open fat this time in one of the option you'll find adapter 'word' at the end of one of the s long option name click this title of void, you will find some title in one of the name of titles there are "Power management."  Uncheck the options that are probably ticked then click 'ok' and then pair your Bluetooth, this time it should work correctly.

    Let me know if it worked for you guys, hopefully

  • Tiara startup script does not work when running file associated with

    Hello

    I have a startup script that works correctly with tiara itself, however when I open a file associated with tiara (tdms files) the startup script does not work.  Is it possible to ensure that the script runs without worrying?  Thanks for the help!

    Bala

    Hi Bala,

    Depending on your use case, I suggest you call the next VI, which comes with LabVIEW, after your purchase VI is the creation of the data file.  Just pass the data file path in the upper part of entry and your path to the VBScript file in less than entry.

    "C:\Program Files (x 86) \National Instruments\LabVIEW 2013\vi.lib\ExportToExcel\DIAdem report Assistant Start CSC.vi '.

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • program no longer works when compiling

    I don't really know why, but when I compile this program RS232 base, it no longer works.  It works very well in the LabView block diagram/façade real.  Does anyone have any suggestions?

    Thank you


  • Transparency no longer works when recording in png

    I've used photoshop for years.

    Out of the blue something strange happened to me today.

    When I try to save a PNG with a transparent background, it no longer works.

    The background is white, no matter what I do.

    Everyone fell on this problem and if so, please tell me how I can solve this problem?

    so embarrassed. It wasn't a matter of photoshop. It was my image viewing program that I used to display the image on my hard drive after I save it from photoshop.

    It seems that my player to date and when he does this he changed the display of the background transparent white Uni.

    So it wasn't a matter of photoshop.

    Thanks Chuck

  • Internal server messages no longer work when published on the web server, but not locally on the web server

    Just upgraded to 8 Captivate and for some reason my server any internal messages is no longer work on the web server.  I can test locally the lesson that always points to the Web server and it works.  Can't understand why when it is on the server it does not work.  The ashx handler that manages to post is fully accessible to the web server and DNS solves very well so I can't understand why he doesn't hit the Manager.  I use IIS to host it and a .ashx for managing for results.

    Is there maybe something new that needs to be allowed in IIS for 8 Captivate work?  .js seems to be fine and firewall is not the issue.  Short of ideas and the need for this work as soon as possible.

    Thank you very much for your help!

    Nick

    OK, finally solved.  For some reason any run under HTTPS lesson could not publish my results.  As soon as I changed to HTTP the results perfectly. All of this makes sense why I could post locally on the Web server.  Hope this saves someone else 5 days of hell.

  • Flash no longer works when refreshing a page template

    Recently moved from GoLive to DW CS3. I bought Total Training for DW CS3 to help the transition.

    I am wanting to create a page template to use for the entire site, so if I need to make a change to the model, it updates my entire Web site.  When I download the page, the flash image load very well. The problem I have is if I reopen the page template.dwt and make a change, when DW updates the pages that are related to the model, the flash of images in the pages no longer work.

    Here are my steps that I took:

    1 create a page named index.html

    2. an editable region called "main content" insert > template objects > editable region

    3. has created a folder named templates in the root directory

    4. file > save as template and called home.html (for testing so not joking my work index.html page)

    5. file > new > Page model and chose my file template.dwt

    6. adding content to the page.

    7. file > save as a society - hist.html

    8 download index.html and home.html company - info.html on the server.

    Everything works as it is supposed to.

    9. open template.dwt and make a change.

    10. save the page and DW updates pages home.html and company - info.html

    11 download to the server

    12 flash image on these two pages stop working

    Here are links to my pages

    Index - works

    Home - (from template) Flash does not

    Company Info - Flash works (didn't model) Flash does not


    Any ideas where I'm wrong?

    Oh, I see that you did.  So in the template file, make it.

    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','900','height','256','title','Main Flash Slideshow','src','../images/Main-Flash-Slideshow','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','../images/Main-Flash-Slideshow' ); //end AC code
    

    Read like this-

    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','900','height','256','title','Main Flash Slideshow','src','/images/Main-Flash-Slideshow','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','/images/Main-Flash-Slideshow' ); //end AC code
    

    See if that helps.

    Post edited by: Murray * CPA *.

  • Scripts to stop working when lying down with the 'extra features '.

    I have a few scripts that work very well to both Pro and the player, but when I Save As-> Reader Extended PDF-> activate additional features, they stop working (both Pro and player). Other scripts in the same form continue to operate perfectly. I am at a total loss, and so are my IT people (who certainly aren't exactly experts form/JS/Adobe...)

    I fight with this problem and for a week or so now and I tried a couple of different approaches - I'm a JS pilon, and I'm sure that there are more effective ways to do what I want to do. But what I'm trying to give me a different problem . I'll try to separate different issues in different positions... but I'm confused enough!

    For what it's worth, problem scripts are on the first and last master page, while those who are working is on normal pages.

    The goal is to reuse a partially completed form for several different phases of an approval process. Each version gets a different title and a further subform is visible during the phases of 2nd, 3rd and 4th.

    Here are the global workflow:

    • Phase 1
      1. The form begins with the title of Phase 1 and the additional subform 'hidden '.
      2. A remote user fills out the form and return to the program coordinator.
    • Phase 2/3/4
      1. The Coordinator saves a copy of the form with a different name.
      2. The Coordinator checks a check box "for admin use only" to show a group of radio buttons. Each option modifies the title and sets the presence of additional subform to "visible".
      3. The Coordinator Unchecks the check box "for admin use only" to hide the radio buttons.

    The title is in a text field. Scripts change the rawValue of the field for each option.

    In this case, I have the following script to initialize it and calculate the event of the text box:

    If (S_SelectTitle.S_Actions.RB_SelectTitle.rawValue == 2( )

    this.rawValue = ' Phase 2 ';

    otherwise if (S_SelectTitle.S_Actions.RB_SelectTitle.rawValue is 3( )

    this.rawValue = ' Phase 3 ';

    otherwise if (S_SelectTitle.S_Actions.RB_SelectTitle.rawValue is 4( )

    this.rawValue = ' Phase 4 ';

    on the other

    this.rawValue = ' Phase 1 ';

    and a similar code in the events, initialize and calculation of the subform to make his presence 'visible' or 'hidden '. (I used this strategy before initialize/calculate event, it has always worked well. But I "(ve rencontrer deles de problèmes avec elle dans l'une deles de approches remplaçant je me sers dans le présent formulaire, donc je suis totalement ouvert àles autres moyens de le faire...)"

    Until I developed the form for the reader, it works fine. The changes of title properly selected button, the new subform appears at the end, and option buttons disappear when the box is unchecked.

    After I extend for reader, nothing works except the checkbox. The title does not change, and the subform never appears.

    Help? Thanks in advance!

    Well, it seems that the interactive objects on master pages are problematic. Using a few of message boxes, we discovered that the Initialize event fires whenever a radio button on a master page is selected, but not when the radio button is in the body of the form.

    So whenever we clicked on the option button on the master page, the event initialize the value of the group just exclusion set back to the default value (which was zero, in this case). So the title never changed, because the radio button setting glue.

    For this form, I found a way to remove the option buttons in the master page. Not only the titles in headers change correctly, the form also works with the enabled extensions Reader!

    I don't know what problem was hanging me up - the buttons on the master page or Reader extensions - or if they are tied together in some way. But the moral of the story for me, anyway, no more buttons on master pages. Hope this helps someone else!

  • Why my scripts does not work when scheduled in the calendar?

    Hello

    I created scripts to start and stop onedrive using the "Tell" command

    When I plan their schedule they fail to run.  They were created as programs and work if I launch them manually.

    Is there something that I am missing?  Or is there a better way?

    PS: Scripts are the OneDrive to run after hours to prevent it completely hogging my bandwidth to broadband.

    If there is a better way to control the use of bandwidth for OneDrive I would be grateful.

    See you soon

    Memn

    A workflow schedule alarm will not work unless it is attached to a local calendar ("on my Mac"), instead of a network such as iCloud calendar.

  • wireless keyboard no longer works when I changed the batteries

    my keyboard microsoft keyboard elite 1002 says she is low on battery.  I changed the batteries.  The keyboard was not working so I searched on bluetooth, did not find it and re - he added.  I let him choose the password.  I typed on the keyboard and press enter on the keyboard.  The unit now looks like being there.  But it does not work.  I tried to do these steps (remove and add the keyboard) 3 times.  What could be wrong?  The power of the battery shows as "good" when I checked in the properties of the keyboard.

    Hi ckcinc,

    You can follow this link & check if it helps.

    Resolve the failure of mouse or a Bluetooth keyboard to function

    You can also contact the Microsoft Hardware support for assistance.

    Hope the helps of information. Please post back and we do know.

    Concerning
    Joel S
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Features of the VPC integration no longer works when transferred to a new pc

    Hi guys.

    I used VPC since it was released for years XP.  I am now on Windows 7 and run several XP/7 VPC.

    A problem I meet always is when I update my host PC or operating system and the transfer on the VPC files it always seems to break the integration features for the user I created initially in the VPC.  So to say that I have a user named 'user' in the virtual XP computer when I first create through integration running and works.  Then I get a new laptop and transfer on my VPC include the VHD and VMC files and try running it, integration features will not start - still, it gives an error and says to restart the virtual computer.  I tried to uninstall and reinstall the tools of integration, but it makes no difference.

    If I create a new user in the VPC and log with that integration works just find, but that means, I lose all my settings.  I if returns to modify the registry profile path so that it points to the initial directory of user profile that I receive all my sessions back but the problem with the integration starts do not.

    I guess it has something to do with the credentials saved in the user profile.  I try to remove some of the more obvious things that does not.

    Someone at - it a preview?

    Thank you
    Ernie

    Hi Ernie,.
     
    Thanks for posting your query in Microsoft Community.
     
    I understand that you have problems with Virtual PC in Windows 7.
     
    The question you have posted is related to Virtual PC and it would be better suited to the TechNet community.
     
    Please visit the link below to find a community that will provide the support you want. http://social.technet.Microsoft.com/forums/en-us/w7itprovirt/threads

Maybe you are looking for

  • Need the card reader drivers Win7 memory for Satellite P200

    Hi, I just installed windows 7 on my Satellite P200 but it doesn t t recognize the memory card reader. Does anyone have a solution or do I have to buy a USB memory card reader? Thank you

  • iPhone 5 s Activation help

    Received today an iPhone 5 s of my aunt. She said to restore. I did as told, restored, ran into the lock to activate icloud. She said that the email has been removed for a long time because of security concerns. Need help to repair the lock without t

  • How can I recover hal/dll library - computer restart without warning

    My computer kept restarting with warning message. Detectors of viruses and malicious software nothing - nothing did fall within the firewall either.  When we tried to recover to an earlier point (it started when Microsoft had us install malicious pro

  • HP OJPro8610 user guide

    As expected, the printer is supplied with a minimum documentation.  I was expecting to find a decent online user guide, however.  Any idea where I can get one?  Support Web page shows no user guide I can find the download link.  Thank you

  • RegCure ParetoLogic Pro, Inc., maintenance & health for PC Applications

    I was looking for help online and in the same place, I inadvertently pushed a button. It down immediately loaded an application for the cleaning of your operating system. He called RegCure Pro of ParetoLogic, Inc., after running it, the message infor