AppleScript Additions...Huh?

I'm trying to learn AppleScript. I have the script below, that's supposed to generate prime numbers. It comes with an "AppleScript Addition" called "Math Commands".
Is there something I'm supposed to do with the AppleScript addition in order to get the Primes script to run?
Thanks,
Bob
local min, max, neverZero, maxDiv, divTry, res
-- Here you can set any range that suits you
set {min, max} to {1, 100}
set res to {}
-- By some people's opinion, 1 is not considered a prime
if min = 1 then set min to 2
-- 2 is special, so it has to be handled in its own way
if min = 2 then set {res, min} to {{2}, 3}
-- We can't use even numbers, because they are never primes, except for 2
if min mod 2 = 0 then set min to min + 1
repeat until min > max
set maxDiv to («event Måthfloo» («event Måthsqrt» min)) as integer
set {neverZero, divTry} to {true, 3}
repeat until divTry > maxDiv
if min mod divTry = 0 then
set neverZero to false
exit repeat
end if
set divTry to divTry + 2
end repeat
if neverZero then set res to res & min
set min to min + 2
end repeat
{Numberofprimes:length of res, Listofprimes:res}

Hi Bob,
Is it the Math Commands mentioned here?
http://osaxen.com/files/mathcommands1.0.html
If so I think it is written for OS9 and won't work in OSX.
This script doesn't need an OXAN in OSX. Try this:
local min, max, neverZero, maxDiv, divTry, res
-- Here you can set any range that suits you
set {min, max} to {1, 100}
set res to {}
-- By some people's opinion, 1 is not considered a prime
if min = 1 then set min to 2
-- 2 is special, so it has to be handled in its own way
if min = 2 then set {res, min} to {{2}, 3}
-- We can't use even numbers, because they are never primes, except for 2
if min mod 2 = 0 then set min to min + 1
repeat until min > max
set maxDiv to round (min ^ (1 / 2)) rounding down
set {neverZero, divTry} to {true, 3}
repeat until divTry > maxDiv
if min mod divTry = 0 then
set neverZero to false
exit repeat
end if
set divTry to divTry + 2
end repeat
if neverZero then set res to res & min
set min to min + 2
end repeat
{Numberofprimes:length of res, Listofprimes:res}
Best wishes
John M

Similar Messages

  • Per-contact alert settings

    There was, in Mountain Lion, a way to set individual alert sounds for each Buddy, or to have Messages speak the message. But I cannot find this feature in Mavericks. I'm pretty sure it was in the Profile for that buddy, though it may have been on the contact card.
    In any case, I can no longer find this feature. Where did it go?

    Hi,
    I am afraid Apple left this feature in the bin.
    When Apple did away with the Alerts preference pane and the options to change any sound, on any actions, with Dock Bounces or Applescript additions we also lost the option in the Buddy Info Panel to set the Alerts there.
    8:10 pm      Thursday; November 28, 2013
      iMac 2.5Ghz 5i 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • Can AppleScript schedule additional Startup/Shutdown events?

    My question: Can an AppleScript be written that would Startup my Mac on a weekly basis, run Software Update then Shutdown?
    I don't want to lose the daily Shutdown/Startup cycle I have scheduled in Energy Saver now. I would need the script to run a cycle that didn't interfere with it.
    I remember finding a site several years ago that taught AppleScript over a series of sessions. It was an excellent site and I had started it but never finished. I don't remember the URL or if it's still in existence.
    Can someone recommend a similar site?
    Thanks
    iMac 2Ghz Core Duo, G3/BW 600Mhz, iBook G3 600Mhz, StarMax 5500 240Mhz   Mac OS X (10.4.7)   WINDOWS: eMachine DT, Averatec 12" LT

    Question withdrawn

  • Help in Applescript?

    Hey guys I really need help here...
    I've been trying to write an applescript to login my college account.
    I got pass the sign in part but im stuck on figuring out how to click a certain button on the webpage.
    Did a little research and found that it was either UI scripting that I should use or java command.
    But im on OSX Maverix and I can't figure out how to enable UI scripting and how to use it (in doesn't show in the accessibility list)
    And for the java commands, I know how to find the source code of a page but i can't figure out how to find the button code, and how to write the script... Any help would be appreciated thank you!
    So far thats my script:
        set thePassword to *password*
        set theID to *IDnumb*
        tell application "Safari"
        Activate
        Open Location *Website*
        delay 5
        keystroke ID
        keystroke tab
        keystroke password
        keystroke return
        delay 2
    End tell

    Here is how I navigate these two panels.  First, I click on the vnc icon.  I then curser down to to the line "Connect to Listening VNC Viewer...".  Press return.  Type in ip address.  Press return. 
    first part clicks on vnc icon.
    move mouse and click mouse are not standard.  They are an applescript addon  see comment below.  Do not know if available with mavericks.
    For you situations you probably do not have to click on the button. Use the tab to move to the button you wish to click.  Press return.  ( keystroke return )
    log "  --- Starting on " & ((current date) as string) & " --- "
    -- Go after screen resolution
    do shell script "/usr/sbin/system_profiler SPDisplaysDataType | grep 'Resolution'" -- get info
    tell the result to set {DisplayWidth, DisplayHeight} to {word 2, word 4} -- get resolution
    if DisplayWidth = 800 then
        (move mouse {474, 14})
    else
        (move mouse {698, 11})
    end if
    click mouse
    tell application "System Events"
        repeat 6 times
            key code 125 -- cursor down        key code 125
            delay 1
        end repeat
        delay 2
        keystroke return
        delay 3
        keystroke "192.168.0.101:5900"
        -- if you went to press return after typing the password
        delay 3
        keystroke return
        -- incase we get an error message. should probably be ok, in good case.
        delay 3
        keystroke return
    end tell
        First, there is the XTools scripting addition, which will give AppleScript the ability to move the mouse.
        http://www.lestang.org/osax/XTool/
        XTool-2.0.dmg.tgz
        Installation :
        Drag XTool.osax from insite the image to one of the following locations (create the directory if it does not exist) :
        a : ~/Library/ScriptingAdditions/
        b : /Library/ScriptingAdditions/
        c : /System/Library/ScriptingAdditions/
        I have it in directory /System/Library/ScriptingAdditions/
        My other two directories do not exit: ~/Library/ScriptingAdditions/ &
            /Library/ScriptingAdditions/
    .     Next, you will need to place a script application into your login items (System Preferences > Accounts > Login Items) that will move the mouse when you log in:

  • Do shell script problem in Applescript

    Hi,
    I am an Applescript novice and have been trying to write a code to go to a particular folder, look for all files in the folder tree with extension .m2v and run an executable file to decode them. My problem is that when I run my code (containing do shell script), it searches through all files and folders on Mac HD and starts decoding .m2v files elsewhere that I don't want.
    Eventually it runs out of space (.m2v file decoding takes a lot of space), because it is dumping all decoded .yuv files onto the HD.
    When I run the command on Terminal, it executes the decoding perfectly and stores the decoded files in the same folder.
    Please help me about what's going on.
    My code is something like:
    tell application "Finder"
    set DestinationFolder to "xxxxxx:xxxx:xxxx"
    set NumFolders to (get count of folders under Destination folder)
    repeat for SomeVar from 1 to NumFolders
    set FolderinQuestion to folder SomeVar of DestinationFolder
    -- Tried tell application "Terminal" here, but did not know --how to export the FolderinQuestion variable from Finder to --Terminal
    do shell script " \" cd \" & (POSIX path of (result as text));
    for file in `find $pwd \"*.mov\"`
    do
    /usr/local/bin/decode file
    done"
    end repeat
    end tell
    I would greatly appreciate some guidance.

    The root of the problem is that you're trying to quote the cd command for some reason:
    <pre class=command>do shell script " \" cd \" & (POSIX path of (result as text));
    ...</pre>
    In addition to that you're including the & (POSIX path of (result as text)) as part of the shell command whereas this should be OUTSIDE of the quotes in order to get evaluated
    If you work that through you'll end up with a shell command that looks like:
    <pre class=command>" cd " & (POSIX path of (result as text))</pre>
    If you try to run that in a terminal you'll get a cd : command not found error and that's why the rest of it appears to fail.
    The solution to that one is simple - just don't bother quoting the cd and put the POSIX path stuff outside of the quotes to get it evaluated at runtime:
    <pre class=command>do shell script "cd " & quoted form of POSIX path of (FolderInQuestion as text)) & ";
    # rest of shell commands here"</pre>
    Now, as for the rest of the script there are a few things I would change.
    First, unless you need to know the index, don't do:
    >repeat for SomeVar from 1 to NumFolders
    set FolderinQuestion to folder SomeVar of DestinationFolder
    the issue is that the number of folders to process may change during the script's execution (other processes may create or remove folders). This will, at best, cause some folders to be skipped and, at worst, cause the script to fail.
    If you're iterating through a list, the best option is to just:
    <pre class=command>repeat with FolderInQuestion in (folders of DestinationFolder)
    ...</pre>
    This automatically sets the iterator (in this case, FolderInQuestion, to the first item in the list and increments it for each iteration through the loop.
    Secondly, in your shell script itself, scrub the entire do/done loop. You're already using find, so have that do the hard work using the -exec switch:
    <pre class=command>find path -name "*.mov" -exec /usr/local/bin/decode {} \;</pre>
    In find's case, {} is substituted with the current file's path.
    Putting this together you'd get:
    <pre class=command>tell application "Finder"
    set DestinationFolder to "xxxxxx:xxxx:xxxx"
    repeat with folderInQuestion in (get folders of folder DestinationFolder)
    do shell script "cd " & quoted form of POSIX path of folderInQuestion & "; find . -name \"*.mov\" -exec /usr/bin/decode {} \\;"
    end repeat
    end tell</pre>
    Note that I've used 'quoted form of POSIX path' - this takes care of any shell-unsafe characters like spaces in the path name. I've also used \\; for the -exec switch - this is so that AppleScript passes the \ to the shell command rather than using it for its own escaping.
    But you're not done yet!
    There's still one fatal flaw in this process - and that is the fact that find by default, is recursive - it will walk through every directory that it finds.
    This means that if you start at the top folder and iterate through, find will find all .mov files and decode them. Your script then cd's to the first subdirectory and repeats the process - decoding all the .mov files in that directory and all its subdirectories even though they've ALREADY been decoded.
    The upshot is that you only need to run one loop starting at the top level. You don't need to iterate through all the subdirectories since find will do that for you.
    In addition to that, there might not be a need to use cd at all since the first argument to find is the directory to start searching in. Unless there's some reason that you need to start decode from the top level directory (e.g. is that where it saves the files?), you can drop the whole repeat loop altogether and just run with:
    <pre class=command>set startFolder to (choose folder)
    do shell script "find " & quoted form of posix path of startFolder & " -name \"*.mov\" -exec /usr/bin/decode {} \\;"</pre>
    That's the entire script - a radical compression of your original.

  • Shell Script or Applescript to run disk permissions repair

    Tried doing this Applescript in Automator:
    do shell script "sudo diskutil repairPermissions /" ¬
      password "yourAdminPassword" with administrator privileges
    This works, but the process appears to run without shutting down when it's done.
    Can anybody suggest an addition or modification to terminate when the permissions repair is completed?

    do shell script ¬
              "sudo diskutil repairPermissions / ; exit" password "yourpassword" with administrator privileges

  • Pages 2.0 / Applescript / Inserting an image

    Heya all,
    I'm trying to write a script that inserts a pdf from the desktop into an image placeholder in a pages 2.0 template.
    Having looked at the applescript dictionary, I'm quite confused since there seems to be a way to do that, but I can't figure out how...
    would anyone know how to do that ??
    that would help me a great deal,
    thank you.

    Pages doesn't have many custom verbs, but it makes use of make and set.
    Astroboy asked about changing an existing image placeholder, which uses set.
    To create a new image (insert), use make:
    <pre>
    tell application "Pages"
    tell (make new document with properties {template name:"Blank"})
    -- Floating, at 6, 2 inches (uses your units preference setting)
    make new image with properties {image data: alias ":Library:Desktop Pictures:Nature:Ladybug.jpg", horizontal position:6.0, vertical position:2.0}
    -- Inline at the very end.
    make new image with properties {image data: alias ":Library:Desktop Pictures:Nature:Ladybug.jpg"} at after every text of body text
    end tell
    end tell
    </pre>
    In addition to a file alias for the image data, you can use picture data, like you might get from an image field in FileMaker, or the clipboard in Standard Additions.
    Titanium PowerBook   Mac OS X (10.4.4)  

  • Applescript to open the Choose Folder dialog box and close the message after moving it

    I've been trying to figure out how to get the same functionality as the Windows version of Outlook has so that the open message gets closed when it's moved to another folder.
    It seems pretty simple to move a message to a pre-defined folder, but I can't find a way to open the Choose Folder dialog so I could choose the destination folder. I've looked through the dictionary, but couldn't find any direct way to activate the Choose Folder dialog. So I decided to use keystrokes for the job. Here's what I came up with:
    on run {}
        tell application "Microsoft Outlook"
            try
                set theMessage to first item of (get current messages)
                set folderID to the folder of theMessage
            on error errMsg number errNum
                set dialogReply to display dialog "Please select one or more messages to file away before running this script." buttons {"Abort"} default button 1
                return
            end try
            -- open the Choose Folder dialog
            tell application "System Events" to keystroke "m" using {command down, shift down}
            repeat
                delay 2
                set currentID to the folder of theMessage
                if currentID is not folderID then exit repeat
            end repeat
            -- Close the active message
            tell application "System Events" to keystroke "w" using command down
        end tell
    end run
    This is my first attempt to do anything with AppleScript..
    Now in addition to using keystrokes instead of Outlook built-in commands to open the Choose Folder dialog and to close the message, I also have another problem. Everytime I run the script from AppleScript Editor, everything runs fine, the message gets moved to the folder I choose and the message also gets closed. When I move the script to "~/Library/Application Support/Microsoft/Office/Outlook Script Menu Items" and start it from inside Outlook, Outlook  gets stuck after opening the Choose Folder dialog and I have to force quit Outlook. I added some debuggin to the script and found out that the script keeps running, but I'm unable to select the folder from Outlook and cannot continue.
    Anybody have an idea why this is happening?
    Regard,
    Kris

    (For the record)
    Unchecking "Submit crash reports" in the Firefox [[Options window - Advanced panel]] General tab simply toggles the default of the "Tell Mozilla about this crash so they can fix it" check box in the Mozilla Crash Reporter dialog (upon crash). It does not turn off the Crash Reporter itself.
    Related bug report:
    * [https://bugzilla.mozilla.org/show_bug.cgi?id=577221 Bug 577221 - Firefox doesn't remember "submit crash report" check box]
    The above information has been added to
    http://kb.mozillazine.org/Breakpad#Can_I_disable_Crash_Reporter.3F

  • How can I use a Java program to write an executable Applescript

    I'm using a PC with Windows XP. I'm a private developer. I've written a project in Java and wish to deploy it to other people using email. I've written an Install program (the Main-Class) and successfully packed this in a jar file with the project class files and some data files all as described in the deployment trail in the Java Tutorials. A recipient with a Mac with OS X downloads the jar file and runs it to install the project class files and some data files. The install program then writes an Applescript file (Vocab.scpt shown below) on the Desktop to make starting my downloaded program easier but it doesn't seem to work and I think it may be because the script file is not "executable". Could this be the case? If so, how could I change my install program to make the script file executable or alternatively use some other system to start the downloaded program?
    Vocab.scpt:-
    # Script to start: Vocab Version: 1.0.0
    do shell script "cd /Applications/Vocab; Java Vocab"
    Many thanks for your interest. Unfortunately I don't have a Mac to experiment with this problem and although I have spent some days on and off trying to find an answer in the mass of information available on Apple's website I can only find small clues here and there to answer my problem (which I would have thought was quite a common one). In Windows a batch file (eg. Vocab.bat) is automatically executable.

    I didn't expect you to have your customer run the command. I would expect you to create the executable and install it. However, there wouldn't be any difference in what you are creating and the .jar file. Either way it is a faceless icon. For that matter, it is no different than a batch file on Windows. I'm not sure what they wouldn't understand with, "copy the Vocab.jar file to wherever you want and double-click it to run the program." In addition, you probably ought to point out that Java is not installed on Mac OS X Lion (10.7.x) and when they double-click the jar file (or whatever you send them), the system will ask if they want to install Java.
    What you really need to do is package up the app inside a Mac application package and provide the user with the application on a .dmg (disk image). Take a look here: http://developer.apple.com/library/mac/#documentation/Java/Conceptual/Jar_Bundle r/Introduction/Introduction.html#//apple_ref/doc/uid/TP40000884
    I also found this which uses ANT to create the bundle: http://informagen.com/JarBundler/

  • Can I use applescript to export PDF search results from "preview"?

    My question is about "Preview". I have a very large PDF document that I am using preview to view. After doing a search for a specific word, preview has returned 1200 results. The results panel shows the page number the result is found on and the line of text on which the searched-for-word is found.
    My question is this: Is there a way to export this information from preview to something like an excel file? The end result would look like a table with two columns. One with the page numbers and one with the line of text in which the word appears.
    Is this something that can be done with applescript? I don't know if the system even stores that kind of information... /sigh. Any help is appreciated.

    Using Preview.app, I have done a search for the word “AppleScript” in the PDF version of the AppleScript Language Guide. Then, I have used the following script to retrieve the information displayed in the results panel.
    tell application "Preview" to activate
    tell application "System Events" to tell process "Preview"
    return value of text field 1 of rows of outline 1 of scroll area 2 of splitter group 1 of window 1
    end tell
    --> {missing value, "AppleScript Language Guide (Page 1)", "AppleScript Language Guide (Page 1)", "Contents (Page 4)", "Contents (Page 4)", "Contents (Page 9)", "Figures, Tables, and Listings (Page 11)", "Figures, Tables, and Listings (Page 11)", "Introduction (Page 14)", "Introduction (Page 14)", "Introduction (Page 15)", "Introduction (Page 16)", "AppleScript Lexical Conventions", "Identifiers", "Keywords", "Literals and Constants", "Record", "Variables", "Statements", "Raw Codes", "AppleScript Fundamentals", "Script Editor Application", "What Is in a Script Object", "Properties", "What Is in an Object Specifier", "Absolute and Relative Object Specifiers", "Object Specifiers in Reference Objects", "Coercion (Object Conversion) (Page 32)", "Coercion (Object Conversion) (Page 32)", "Scripting Additions", "Types of Commands", "Parameters That Specify Locations", "AppleScript Constant", "text item delimiters", "version", "true, false Constants", "The it and me Keywords", "Specifying Paths", "Working With Files", "eppc-Style Specifiers", "Debugging AppleScript Scripts", "Third Party Debuggers", "Defining Properties", "Local Variables", "Using the copy and set Commands", "Scope of Variables and Properties", "Scope of Properties and Variables Declared in a Script Object (Page 54)", "Scope of Properties and Variables Declared in a Script Object (Page 54)", "Scope of Properties and Variables Declared in a Script Object (Page 55)", "Scope of Variables Declared in a Handler", "Script Objects", "Defining Script Objects", "Initializing Script Objects", "Inheritance in Script Objects", "Defining Inheritance Through the parent Property", "Using the continue Statement in Script Objects (Page 63)", "Using the continue Statement in Script Objects (Page 63)", "Defining a Simple Handler", "Handlers with Labeled Parameters", "Handlers with Patterned Positional Parameters", "Recursive Handlers", "Calling Handlers in a tell Statement", "Saving and Loading Libraries of Handlers", "idle Handlers", "Calling a Script Application From a Script", "alias", "application (Page 80)", "application (Page 80)", "boolean (Page 83)", "boolean (Page 83)", "class", "constant", "date (Page 87)", "date (Page 88)", "integer", "list (Page 91)", "list (Page 91)", "real", "record (Page 95)", "record (Page 95)", "script", "text (Page 98)", "text (Page 99)", "text (Page 100)", "text (Page 101)", "text (Page 102)", "unit types", "Commands Reference (Page 107)", "Commands Reference (Page 107)", "activate", "ASCII number", "copy", "count", "display dialog (Page 127)", "display dialog (Page 127)", "do shell script", "get", "get eof", "launch", "open for access", "path to (application)", "run", "run script", "say", "set (Page 155)", "set (Page 155)", "summarize", "system info", "write", "Arbitrary", "Filter (Page 169)", "Filter (Page 169)", "ID", "Index", "Middle", "Operators Reference (Page 179)", "Operators Reference (Page 181)", "Operators Reference (Page 181)", "Operators Reference (Page 182)", "Operators Reference (Page 183)", "Operators Reference (Page 184)", "Operators Reference (Page 185)", "Operators Reference (Page 186)", "text (Page 102)", "Examples", "date (Page 87)", "considering / ignoring (text comparison) (Page 194)", "considering / ignoring (text comparison) (Page 194)", "considering / ignoring (application responses)", "error Statements", "error", "if (compound)", "exit", "repeat (forever)", "repeat until", "repeat while", "repeat with loopVariable (from startValue to stopValue)", "repeat with loopVariable (in list)", "tell Statements", "tell (compound)", "try (Page 208)", "try (Page 208)", "using terms from Statements", "with timeout", "with transaction", "continue", "return", "Handler Syntax (Labeled Parameters)", "Calling a Handler with Labeled Parameters (Page 217)", "Calling a Handler with Labeled Parameters (Page 217)", "Handler Syntax (Positional Parameters)", "Folder Actions Reference", "adding folder items to", "closing folder window for", "opening folder", "removing folder items from", "Appendix A: AppleScript Keywords (Page 227)", "Appendix A: AppleScript Keywords (Page 228)", "Appendix A: AppleScript Keywords (Page 229)", "Appendix A: AppleScript Keywords (Page 231)", "Appendix A: AppleScript Keywords (Page 231)", "Appendix A: AppleScript Keywords (Page 232)", "AppleScript Errors", "Operating System Errors", "Catching Errors in a Handler (Page 238)", "Catching Errors in a Handler (Page 238)", "Simplified Error Checking", "When a Dictionary Is Not Available", "Entering Script Information in Raw Format", "List of Unsupported Terms", "Glossary (Page 245)", "Glossary (Page 246)", "Glossary (Page 247)", "Glossary (Page 249)", "Glossary (Page 249)", "Glossary (Page 250)", "Revision History", "Symbols", "B (Page 254)", "B (Page 254)", "G", "I", "M", "R", "S"}
    Many items don't have any page number. Is that what you are asking for?

  • AppleScript - How do I make multiple dialogs display at the same time?

    Is it possible to make more than one dialog be displayed at one time with AppleScript? Thanks in advance.

    You can see what is available in the Standard Additions dictionary. There are a (very) few things you can fake, but AppleScript dialogs are designed for simple feedback.

  • Applescript to Access Calendar

    Hello all, I am creating an applescript to read my iCal events and find out when the next event is. It works fine except for at the beginnning of the program, it asks for permision to access the calendar. I looked into it, and found out to go into settings/security and allow it through to the calendar as you can see below. After I do that, it works well for about a day, but then, it starts asking me to allow it through again. Is there a way to permanantly allow it? An addition to the code or just a setting change would be great.
    As always, any help is appreciated.
    Thanks,
    Ryan Siebecker

    Hello
    The following article would be relevant.
    OS X: Using AppleScript with Accessibility and Security features in Mavericks
    http://support.apple.com/kb/HT5914
    Good luck,
    H

  • How can I control modal dialogs in Applescript without a mouse?

    I am trying to use a Griffin PowerMate button to select between two options in an Applescript modal dialog and cannot seem to figure out how to do this. I can set a default button, but I want the user to select between two options (shifting the highlighted button) via the PowerMate. Does anyone have a suggestion?
    I can program the PowerMate to send/emulate a particular keystroke, but I do not know how to make the standard Applescript dialog respond to a keystroke, only a mouse action. I'm trying to create a mouseless interface.
    In short, I want the dialog respond to "Twist to the left and press the button to select A, Twist to the right and press the button to select B." Thoughts?
    Thank you.

    Your System Preferences > Keyboard Shortcuts > Full Keyboard Access preference will need to be set to "all controls", but it also depends on where the particular button is located in the dialog.  The tab key will highlight the buttons from left to right, shift-tab will highlight the buttons from right to left, and the spacebar will "press" the currently highlighted button.  In addition, the escape key will choose the Cancel button (if there is one), and the return key will choose the default button (if a default has been set the button itself will be lit).

  • ICal does not run one event that has a Applescript attached to it. 24u?

    I have a number of reoccurring events in iCal that run a Applescript.  Tow of them refuses to run.  I have tried it as a Applescript and saved it as a run only and neither works (the script run fine if I test them by hand).
    so I thought I have a look in the log and found this 24u information. 
    can anybody help out here? I am not sure why it appears, if it is good or bad, how to fix it and if it is at all realted to my problem.  Other scripts seem to run well, it is this one and an other one that do not get activated by iCall.
    They run on a MM running 10.6.8, iCall 4.0.4 (1395.7)
    Thanks.
    Log today:
    19/09/2011 07:00:00          iCal Helper[211]          Error loading /Library/ScriptingAdditions/24U Appearance OSAX.osax/Contents/MacOS/24U Appearance OSAX:  dlopen(/Library/ScriptingAdditions/24U Appearance OSAX.osax/Contents/MacOS/24U Appearance OSAX, 262): no suitable image found.  Did find:
              /Library/ScriptingAdditions/24U Appearance OSAX.osax/Contents/MacOS/24U Appearance OSAX: mach-o, but wrong architecture
    19/09/2011 07:00:00          [0x0-0x12012].com.apple.iCal.helper[211]          iCal Helper: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/24U Appearance OSAX.osax" declares no loadable handlers.
    19/09/2011 07:45:01          iCal Helper[317]          Error loading /Library/ScriptingAdditions/24U Appearance OSAX.osax/Contents/MacOS/24U Appearance OSAX:  dlopen(/Library/ScriptingAdditions/24U Appearance OSAX.osax/Contents/MacOS/24U Appearance OSAX, 262): no suitable image found.  Did find:
              /Library/ScriptingAdditions/24U Appearance OSAX.osax/Contents/MacOS/24U Appearance OSAX: mach-o, but wrong architecture
    19/09/2011 07:45:01          [0x0-0x28028].com.apple.iCal.helper[317]          iCal Helper: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/24U Appearance OSAX.osax" declares no loadable handlers.
    19/09/2011 14:30:02          iCal Helper[1019]          Error loading /Library/ScriptingAdditions/24U Appearance OSAX.osax/Contents/MacOS/24U Appearance OSAX:  dlopen(/Library/ScriptingAdditions/24U Appearance OSAX.osax/Contents/MacOS/24U Appearance OSAX, 262): no suitable image found.  Did find:
              /Library/ScriptingAdditions/24U Appearance OSAX.osax/Contents/MacOS/24U Appearance OSAX: mach-o, but wrong architecture
    19/09/2011 14:30:02          [0x0-0x73073].com.apple.iCal.helper[1019]          iCal Helper: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/24U Appearance OSAX.osax" declares no loadable handlers.

    Hi,
    It looks like the version of 24U's Appearance OSAX you have installed does not run on Lion.
    I would contact the developer to see if they have a version that does yet. See http://www.24usoftware.com/AppearanceOSAX
    Alternatively you could look to see if the Applescript really needs to use it.
    Best wishes
    John M
    Edit: If you are running Snow Leopard, I think you may need to make the application "iCal Helper" (which you'll find in iCal's application package) run as 32 bit. I'd also suggest you check this with 24U.

  • Applescript 'Contacts' code error with Maverick

    After upgrading from MacOSX 10.6.8 to Maverick my applescripts are creating errors. One example is the following script which works fine if you run it from within the 'Applescript Editor.app' (v 2.6.1) under Maverick but creates a "Data paste section" error -1743 from the 'Contacts' app if you run the script indpendently. Any hints anyone on how I might return this script to full indpendent functionality?
    Script to load a raw address for conversion and inserting into Address Book
    Wish list
    1.    Check if 'New Address' Group already exists and if it doesn't then create one.
    2.    Provide a dialog that enables the user to specify which group to attach the new address to.
    3.    Find the new address and show it in Address Book.
    4.    Create a list of existing Groups to chose from to reduce keyboard error. --> done but the resultant window is not complete - no scroll bar becomes active.
    Problem code:
    set theFiles to (every file of folder addressesFolder) as alias list
    global ABactive, aExists
    property testText : "http://address-parser.com"
    property newGroup : "New Addresses" --> Default group for new address additions
    property aPrefix : ""
    property aFirstName : ""
    property aMiddleName : ""
    property aLastName : ""
    property aSuffix : ""
    property aPosition : ""
    property aDepartment : ""
    property aCompany : ""
    property aCompany2 : ""
    property aStreet : ""
    property aStreet2 : ""
    property aPostbox : ""
    property aPlace : ""
    property aPostPlace : ""
    property aState : ""
    property aZip : ""
    property aPostboxCode : ""
    property aCountry : ""
    property aPhone : ""
    property aPhone2 : ""
    property aMobile : ""
    property aFax : ""
    property aEmail : ""
    property aWebsite : ""
    property aNote : ""
    set newline to ASCII character 10
    -- Select the desired file
    try
        set addressFile to (choose file with prompt "Choose an address file:" of type {"public.text"} without invisibles) as text
        --    set addressFile to (choose file with prompt "Choose an address file:" of type {"public.text"} default location addressesFolder without invisibles) as text
        -- note the data type set for 'addressFile' is 'text'
    on error number -128
        -- User pressed 'Cancel' button
        return
    end try
    set AppleScript's text item delimiters to {":"}
    set fileName to last text item of addressFile
    set AppleScript's text item delimiters to {""}
    (* If there is an error while processing the address file, delay it just long enough to close the file access. Otherwise continue. *)
    set addressFileReference to open for access addressFile
    -- 'addressFileReference' is the 'returned access number'
    -- Check first to see whether the file was created with output from the expected source
    try
        set wholeFile to read addressFileReference as text
        if (offset of testText in wholeFile) is equal to 0 then
            display dialog "File chosen is:" & return & fileName & return & return & "This file does not appear to contain output from the 'http://www.address-parser.com' demo page." buttons {"Cancel"} default button 1 with title "Error!" with icon stop
        end if
    on error number -128
        -- User pressed 'Cancel' button
        close access addressFileReference
        set wholeFile to ""
        return
    end try
    close access addressFileReference
    set wholeFile to ""
    -- Reopen file (need to clarify why EOF error if two read calls made with file open).
    set addressFileReference to open for access addressFile
    try
        set AppleScript's text item delimiters to {""}
        -- Read address file contents in 'addressFileContents' as a list delimited by paragraph and tab.
        set x to paragraphs of (read addressFileReference as text)
        set addressFileContents to {}
        set AppleScript's text item delimiters to tab
        repeat with i from 1 to count x
            set addressFileContents's end to x's item i's text items
        end repeat
        set AppleScript's text item delimiters to {""}
        repeat with i from 1 to count of addressFileContents
            if (item i of addressFileContents) is not {} then
                --Every line must be checked as there is no set order
                if text item 1 of (item i of addressFileContents) is "Prefix= " then ¬
                    set aPrefix to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "First name= " then ¬
                    set aFirstName to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Middle name= " then ¬
                    set aMiddleName to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Last name= " then ¬
                    set aLastName to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Suffix= " then ¬
                    set aSuffix to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Position= " then ¬
                    set aPosition to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Department= " then ¬
                    set aDepartment to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Company= " then ¬
                    set aCompany to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Company - line 2= " then ¬
                    set aCompany2 to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Street address= " then ¬
                    set aStreet to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Street address - line 2= " then ¬
                    set aStreet2 to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Postbox address= " then ¬
                    set aPostbox to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Place name= " then ¬
                    set aPlace to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Post place name= " then ¬
                    set aPostPlace to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "State/Region/Province= " then ¬
                    set aState to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "ZIP/Postal code= " then ¬
                    set aZip to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Postal code of postbox= " then ¬
                    set aPostboxCode to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Country= " then ¬
                    set aCountry to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Phone= " then ¬
                    set aPhone to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Phone 2= " then ¬
                    set aPhone2 to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Mobile phone= " then ¬
                    set aMobile to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Fax= " then ¬
                    set aFax to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Email= " then ¬
                    set aEmail to text item 2 of (item i of addressFileContents)
                if text item 1 of (item i of addressFileContents) is "Web site= " then ¬
                    set aWebsite to text item 2 of (item i of addressFileContents)
                --Collect unrecognised elements and place them in the 'Note' field
                if text item 1 of (item i of addressFileContents) contains "Unrecognized values:" then
                    set i to i + 1
                    set aNote to "Additional address bits:"
                    repeat with i from i to count of addressFileContents
                        --display dialog "Note text reads:" & return & "aNote:" & tab & "'" & aNote & "'" & return & "Line #:" & tab & i & return & (item i of addressFileContents) as text default button 1 with title "Debug Dialog"
                        if (item i of addressFileContents) is not {} then
                            if item 1 of (item i of addressFileContents) is "" and ¬
                                item 2 of (item i of addressFileContents) is not "" then
                                set aNote to aNote & newline & text item 2 of (item i of addressFileContents)
                            end if
                        end if
                    end repeat
                end if
            end if
        end repeat
    on error errMsg number errNum
        close access addressFileReference
        -- do some sort of error processing here
        display dialog "An error occurred with the following number and description: " & return & errNum & return & errMsg & return & return & "Item " & (i as string) & tab & "'" & (item i of addressFileContents) & "'" with title "Data load section."
        error errMsg number errNum
    end try
    close access addressFileReference
    --Debug dialogs
    --display dialog (item 1 of addressFileContents as text) & return & return & (item 2 of addressFileContents as text) & return & return & (item 3 of addressFileContents as text) & return & return & (item 4 of addressFileContents as text)
    --display dialog "title:" & tab & tab & tab & aPrefix & return & "first name:" & tab & tab & aFirstName & return & "middle name:" & tab & tab & aMiddleName & return & "last name:" & tab & tab & aLastName & return & "suffix:" & tab & tab & tab & aSuffix & return & "job title:" & tab & tab & tab & aPosition & return & "department:" & tab & aDepartment & return & "organization:" & tab & aCompany with title "Just prior to new record insertion:" with icon note
    --check if Contacts application is active
    tell application "System Events"
        if exists application process "Contacts" then
            set ABactive to true
        else
            set ABactive to false
        end if
    end tell
    --display dialog "title:" & tab & tab & tab & aPrefix & return & "first name:" & tab & tab & aFirstName & return & "middle name:" & tab & tab & aMiddleName & return & "last name:" & tab & tab & aLastName & return & "suffix:" & tab & tab & tab & aSuffix & return & "job title:" & tab & tab & tab & aPosition & return & "department:" & tab & aDepartment & return & "organization:" & tab & aCompany with title "Just prior to create new entry:" with icon note
    --create new address entry
    tell application "Contacts"
        try
            --if the aCompany2 variable is filled append its contents to the aCompany variable
            if aCompany2 is equal to "" then
                set thePerson to make new person with properties ¬
                    {title:aPrefix, first name:aFirstName, middle name:aMiddleName, last name:aLastName, suffix:aSuffix, job title:aPosition, department:aDepartment, organization:aCompany}
            else
                set aCompany to aCompany & newline & aCompany2
                set thePerson to make new person with properties ¬
                    {title:aPrefix, first name:aFirstName, middle name:aMiddleName, last name:aLastName, suffix:aSuffix, job title:aPosition, department:aDepartment, organization:aCompany}
            end if
            --set the Company view binary if no First and Last name
            if (first name of thePerson is equal to "") and (last name of thePerson is equal to "") then ¬
                set the company of thePerson to true
            tell thePerson
                if aPhone is not equal to "" then ¬
                    make new phone at end of phones with properties ¬
                        {label:"work", value:aPhone}
                if aPhone2 is not equal to "" then ¬
                    make new phone at end of phones with properties ¬
                        {label:"other", value:aPhone2}
                if aMobile is not equal to "" then ¬
                    make new phone at end of phones with properties ¬
                        {label:"mobile", value:aMobile}
                if aFax is not equal to "" then ¬
                    make new phone at end of phones with properties ¬
                        {label:"fax", value:aFax}
                if aEmail is not equal to "" then ¬
                    make new email at end of emails with properties ¬
                        {label:"Work", value:aEmail}
                if aWebsite is not equal to "" then ¬
                    make new url at end of urls with properties ¬
                        {label:"Work", value:aWebsite}
                if aStreet is not equal to "" then
                    if aStreet2 is equal to "" then
                        make new address at end of addresses with properties ¬
                            {label:"work", street:aStreet, city:aPlace, state:aState, zip:aZip, country:aCountry}
                    else
                        make new address at end of addresses with properties ¬
                            {label:"work", street:aStreet & ", " & aStreet2, city:aPlace, state:aState, zip:aZip, country:aCountry}
                    end if
                end if
                if aPostPlace is equal to "" then set aPostPlace to aPlace
                if aPostbox is not equal to "" then
                    if aPostboxCode is not equal to "" then
                        make new address at end of addresses with properties ¬
                            {label:"postal", street:aPostbox, city:aPostPlace, state:aState, zip:aPostboxCode, country:aCountry}
                    else
                        make new address at end of addresses with properties ¬
                            {label:"postal", street:aPostbox, city:aPlace, state:aState, zip:aZip, country:aCountry}
                    end if
                end if
                if aNote is not equal to "" then set note to aNote
            end tell
            -- place the new entry into a group
            set myGroups to name of every group
            set theGroup to (choose from list myGroups with prompt "Attach to which group?" without multiple selections allowed and empty selection allowed) as text
            --If user selects 'Cancel' button the value of the result variable is 'false'
            if theGroup is not "false" then
                add thePerson to group theGroup
            else
                -- create a default group and place the entry in there; first testing to see whether the default group already exists
                try
                    if group newGroup exists then ¬
                        display dialog "newGroup exists" with icon 1
                    add thePerson to group newGroup
                on error number -1728
                    -- newGroup does not exist so create it
                    display dialog "newGroup does not exist. Make new group with newGroup" with icon 1
                    set theGroup to make new group with properties {name:newGroup}
                    add thePerson to group newGroup
                end try
            end if
            save application "Contacts"
            set selection to (thePerson)
            activate
    --set flag that new address entry was successful by seeking
            if the selection is equal to properties ¬
                {title:aPrefix, first name:aFirstName, ¬
                middle name:aMiddleName, last name:aLastName, ¬
                suffix:aSuffix, job title:aPosition, ¬
                department:aDepartment, organization:aCompany} then ¬
            set aExists to true
        on error errMsg number errNum
            -- do some sort of error processing here
            display dialog "An error occurred with the following number and description: " & return & errNum & return & errMsg with title "Data paste section."
            error errMsg number errNum
        end try
        --if we opened the AB, we'll close it
        if not ABactive then quit
    end tell
    --clear address variables content in case of repeat use
    set aPrefix to ""
    set aFirstName to ""
    set aMiddleName to ""
    set aLastName to ""
    set aSuffix to ""
    set aPosition to ""
    set aDepartment to ""
    set aCompany to ""
    set aCompany2 to ""
    set aStreet to ""
    set aStreet2 to ""
    set aPostbox to ""
    set aPlace to ""
    set aState to ""
    set aZip to ""
    set aPostboxCode to ""
    set aCountry to ""
    set aPhone to ""
    set aPhone2 to ""
    set aMobile to ""
    set aFax to ""
    set aEmail to ""
    set aWebsite to ""
    set aNote to ""
    -- Delete original file if contents have been successfully added
    if aExists then
        try
            tell application "Finder"
                if exists file addressFile then
                    delete file addressFile --moves it to the trash
                end if
            end tell
        on error errMsg number errNum
            display dialog "Inserting new address was successfiul, however an error occurred while deleting the original file:" & return & addressFile buttons {"Cancel"} default button 1 with title "Error!" with icon stop
            display dialog ""
        end try
    end if
    -- End of 'add address' script

    Well, after a few days of restoring my cellphone (The C6-01 I mentioned before), I came to this:
    - After Hard resetting, the Lock Code is still erroneous;
    - After firmware reinstalling, Lock Code is erroneous;
    - Pulling out the battery, leaving the cellphone with no power for several hours, give the same result;
    - Downgrading firmware (previous version) did not fix the problem;
    Interesting thing is, after power on, the cellphone asks for the code lock: entering ANY number, returns "Code Error", and simply goes back to normal operation.
    Everything is working, except I can no use de Lock Code, or any function related to it.
    Of course, is pretty annoying to enter the lock code every time I power-on the cell.

Maybe you are looking for

  • Have you been getting timeouts and other weird connection issues lately?

    Internet connection has become a bit wonky as of late, have you been experiencing some or all of the following symptons? 1) Most internet speed test sites just stop before completing as if they have timed out (i.e. speedtest.net). 2) Sites will start

  • Labels on Forms are not maintaining positions when viewed on a different computer

    I have a project with 14 forms.  The labels for the text boxes are perfectly aligned on one machine, yet when I run the project on a different machine (same screen resolution and all fonts available) many of the labels are no longer left- or right-al

  • One line

    Hi, I have this query : SQL> SELECT 'SOMETHING',ID_NUMBER FROM TABLE; It returns : SOMETHING 5.01.10.001 How can I do to have all in one line, like following : SOMETHING 5.01.10.001 Many thanks.

  • Auto-accept friend requests

    Hello, is there any way to auto-accept friend requests? Or at least change a setting on my account so people won't need my authorization eveytime someone adds me to their contact list? Thanks!  Solved! Go to Solution.

  • Update infotype without authorisation check

    Hi, I have a requirement to update an infotype without authorisation check. Please let me know if there is any function module I can use to do that. Regards, Lanwu