AppleScript: Classic vs OS X

I was sent an AppleScript to launch an OS X Terminal command. However, when I clicked on it, Mac OS 9 Classic started up (I have a G5 iMac). Since I don't know much about AppleScript, what should I look for in the Script Editor to find out why the script is launching OS 9?

Since no one else has offered anything...
Assuming the script is actually an application (else I don't think it would demand Classic), you may be able to do a 'Get Info' on it and see if 'Open in the Classic environment' box is checked. If so, uncheck it.
If that fails, open the script in Script Editor, make a minor change (add a space, delete the space), recompile it and save it as an application bundle.
One of these two methods has a chance of correcting the problem.
Peter B.
-----

Similar Messages

  • Posting trends and analysis

    I think I've made this comment before, but I'll go ahead and make it again.
    I certainly hope some of the tech support and usability people at Apple are doing some analyses of the posts in this forum. I'm not asking them to read the posts . They just need to do some trending and counting. For example, in the group I like to troll, "Mac OS X Technologies", there are 50 posts listed on the overview page. 28 of those posts are in the iSync category. Therefore, iSync causes more problems than Audio, AppleScript, Classic, Networking and the Web, Unix, and Software Development combined.
    Just an observation...
    I'll go back to arguing about cloning and backup options now until someone posts something interesting in Developer.

    etresoft,
    A statistician once said: if you can't see a simple relation, statistics won't help. Your comment seems a resonable way to draw Apple's attention to serious problems.
    I can't speculate about Apple policy, but I'm not surprised that iSync problems dominate. Cloning can be a problem, restoring a backed-up file tragic, but syncing multiple computers can be a disaster. My advice to family has been to stay away from 'iSync'. This, I admit, was based upon the early releases. It may be safer now.
    In the early 1980s I wrote a 'sync' program for a law firm and saw the problems. I ultimately decided to delete no files, but simply mark them as 'Retired on 'date' (requiring attention). Like backup strategies & restores, the synchronization of computers requires a very careful study before implementing.
    So, I have to agree with both the general suggestion in your original post; and your conclusion about the particular example you chose.
    Bruce

  • Help with a simple applescript for combining Artist text with Track name

    Hi all,
    I'd like to put together a simple script that takes the artist names from a list of tracks in iTunes and copies the text to the start of the Title name, followed by " - ".
    This is because, e.g. on a classical album, I want the artist names to all be "Classic Collection Gold" but I'd like to keep the artist name contained with the track name. This means when I browse by artist I don't get millions of artists...
    I found this script, which does something kinda similar, but I'm new to script writing so not sure how to do it?
    So I'd like to change:
    Name
    Planets: Mars
    Artist
    Gustav Holst
    Ambum:
    Simply Classical Gold (Disc 2)
    To be:
    Gustav Holst - Planets: Mars
    Artist
    Gustav Holst - Planets: Mars OR BETTER Simply Classical Gold (Disc 2)
    Album
    Simply Classical Gold (Disc 2)
    This script has some ideas in, but I'm not sure how to tweak it....
    "Artist - Name Corrector" for iTunes
    written by Doug Adams
    [email protected]
    v1.6 May 17, 2004
    -- removed ref to selection
    v1.5 April 11 2004
    checks if separator string is in name
    v1.0 April 2 2004
    Get more free AppleScripts and info on writing your own
    at Doug's AppleScripts for iTunes
    http://www.malcolmadams.com/itunes/
    property separator : " - "
    tell application "iTunes"
    if selection is not {} then
    set sel to selection
    repeat with aTrack in sel
    tell aTrack
    if (get name) contains separator then
    set {artist, name} to my texttolist(get name, separator)
    end if
    end tell
    end repeat
    end if
    end tell
    -- == == == == == == == == == == == == == == == ==
    on texttolist(txt, delim)
    set saveD to AppleScript's text item delimiters
    try
    set AppleScript's text item delimiters to {delim}
    set theList to every text item of txt
    on error errStr number errNum
    set AppleScript's text item delimiters to saveD
    error errStr number errNum
    end try
    set AppleScript's text item delimiters to saveD
    return (theList)
    end texttolist
    Message was edited by: Chipstix

    I'm not sure what that script thinks it's doing, but it's essentially doing nothing, so scrub that and start afresh.
    The first thing you need is a way to identify the tracks to change - you don't want to do all tracks in the library (they might have already been munged). A good option is to work on the selected tracks:
    tell application "iTunes"
    if selection is not {} then
    set sel to selection
    You then need to iterate through those items, changing them one-by-one:
    repeat with aTrack in sel
    Now comes the easy part - build a list of the elements you want (in this case you want the name, artist, and album of each track:
    set trackName to name of aTrack
    set trackArtist to artist of aTrack
    set trackAlbum to album of aTrack
    Now you have the information you need, so reset the fields as appropriate:
    set name of aTrack to trackArtist & " - " & trackName
    set artist of aTrack to trackAlbum -- or to trackArtist & " - " & trackName, depending on your choice
    Now clean up by closing off the repeat and tell blocks:
    end repeat
    end tell
    Putting it all together you get:
    tell application "iTunes"
      if selection is not {} then
      set sel to selection
      repeat with aTrack in sel
        set trackName to name of aTrack
        set trackArtist to artist of aTrack
        set trackAlbum to album of aTrack
        set name of aTrack to trackArtist & " - " & trackName
        set artist of aTrack to trackAlbum -- or to trackArtist & " - " & trackName, depending on your choice
      end repeat
    end tell

  • Podcast & Audiobook Playback Options on iPod Classic?

    I recently got a new iPod Classic (7th Gen) as an anniversary gift, but I've been having trouble with how it handles Podcasts & Audiobooks - the iPod I used to have was a couple of generations older (I think 5th Gen?).  Basically the two biggest issues I have are:
    1. Podcasts - the older iPod used to play just a single episode, and then exit back to the main menu once the episode was over (unless I queued several episodes together in a playlist).  The new iPods treat podcasts like an album, and continue playing the next track.  This wouldn't be an issue, except that podcasts are sorted in newest -> oldest order, such that it will play Episode 13, then move on to the next track which is Episode 12, and I have to stop it, go back to the menu, and select Episode 14.  Is there any way to get the order to sort ascending (changing it in iTunes didn't appear to affect the order on the iPod at all)?  Or at least an option to play only one episode at a time and not automatically cycle through them?
    2. Audiobooks - I classified my audiobooks into various genres such as "Classics", "Fantasy", "SciFi", etc. in iTunes, and on the old iPod, these genres would show up under Music->Genres in the iPod menu (alongside Rock, Pop, etc.).  This appears to no longer be the case.  Similarly, audiobook authors no longer appear in the list of Artists and audiobook titles no longer show under Albums.  It appears the only way to access audiobooks now is through the
    Music->Audiobooks menu?  And unfortunately it appears as though the Audiobooks menu only lists individual track names, and not Artist or Album?  To make matters worse, the track names are being sorted alphabetically and ignoring the Disc # & Track # metadata stored in iTunes.  Is there any way to fix any of this? 
    Any help would be appreciated!  I've poked around in the settings both on the iPod itself and in iTunes with the iPod connected, but I haven't found a way to correct any of these issues yet. 

    I've found a workaround for this problem: the Join Together v5.1 iTunes script from Doug's AppleScripts combine the segments into two large AAC files.
    Now it's OK if the iPod stops playing segments after they finish because they're hours long instead of minutes.

  • Filemaker Pro loses applescript ability on intel mac

    Hello
    I am trying to install FMP6 on an intel mac. However when I do so, it loses all its applescript ability. Filemaker scripts no longer compile.
    If I go to the applescript library, click the 'add' button, navigate to my filemaker application, it spits up this error: "Unable to add the application or extension because it is not scriptable". This does not happen on a PPC machine. It adds the application perfectly.
    Does anyone have a workaround for this ... other than going back to a PPC or upgrading Filemaker - I mean a workaround to get the dictionary working on an intel mac.

    Short answer: You can't. Buy an older Mac that supports OS 9 booting or Classic mode with OS X 10.4 or earlier.
    Longer answer: There are third party OS 9 emulators that run on Intel Macs. One of them allows one to run OS 9.0.4. But these generally require one to have an OS 9 boot ROM image, and AFAIK there's no way to get one of these that complies with Apple's licensing requirements, other than buying an older Mac that supports OS 9 booting. As such it is against this forum's Terms of Use to discuss it further here. Google is your friend.

  • AppleScript puts control characters in txt file, inflating it enormously

    Hi all,
    I've come across a strange problem. I have an AppleScript file that puts up a dialog box at regular intervals asking me to write down what I am doing (to create an activity log). The file is saved to my Documents folder. This has been working just fine for several months (years), and now, all of a sudden, AppleScript fails on me. The reason is, the log file is inflated out of proportions because it contains hidden control characters (gremlins) between each letter and zillions of them between words and lines. Opening one of these files makes TextEdit go crazy ('Application not responding'). I discovered these gremlins when I opened the document in Classic mode with Word 5 (the best application ever to have been produced by MS, which allows me to remove them and make the file palatable to TextEdit again).
    But that doesn't solve the problem: Every entry continues to be inserted with another load of gremlins, and I can't understand why. I deleted preferences both for TextEdit and AppleScript, and I performed regular disk maintenance.
    TextEdit is set to save plain text files, end-of-line is Macintosh style, character set is Western Mac OS Roman. It's always been like this before when it worked ok.
    Any ideas?
    Thanks in advance.
    G4 MDD 1.25 GHz, 768 MB RAM Mac OS X (10.3.9)

    The solution to my problem can be found in the AppleScript forum here:
    http://discussions.apple.com/message.jspa?messageID=2353871
    With many thanks to reese_, who provided the solution, and to Tom, who directed me there!

  • Hidden control characters in file generated by AppleScript?

    Hi all,
    I've come across a strange problem. I have an AppleScript app (kindly produced for me by a member here) that gets called up by cron, which puts up a dialog box at regular intervals asking me to write down what I am doing (to create an activity log). The log is saved to my Documents folder if it doesn't already exist; otherwise my typing will just get time-stamped and added to the file.
    This has been working just fine for several months (years), and now, all of a sudden, AppleScript konks out on me -- it simply crashes. The reason, I discovered, is the log file itself. It gets inflated out of proportions (something like 2.5 Megs where 40K would suffice) because it contains hidden control characters (gremlins) between each letter and zillions of them between words and lines.
    When the script opens this inflated file, TextEdit balks ('Application not responding'), which in turn crashes AppleScript.
    I discovered these gremlins when I opened the document in Classic mode with Word 5, which allows me to remove them and thus make the file smaller and therefore palatable to TextEdit again.
    But that doesn't solve the problem: Every entry continues to be inserted with another load of gremlins, and I can't understand why. I deleted preferences both for TextEdit and AppleScript, and I perform regular disk maintenance.
    TextEdit is set to save plain text files, end-of-line is Macintosh style, character set is Western Mac OS Roman. It's always been like this before when it worked ok.
    Any ideas?
    Thanks in advance.
    G4 MDD 1.25 GHz, 768 MB RAM Mac OS X (10.3.9)

    Hi Camelot,
    The script doesn't specify TextEdit -- it just creates/updates a text file which I then read with TextEdit. Here's the script, and below is the link to the test log:
    --STARTOFSCRIPT------------------------------------------
    -- Find out if the log file is actually there.
    -- We can't get the last entry of a file that doesn't exist.
    set fileExists to false
    tell application "Finder"
    if exists file "MacHD:Users:gisela:Documents:Gisela'sActivityLog.txt" then set fileExists to true
    end tell
    -- Get the last entry in the log file to present to the user.
    -- If the file wasn't there, present a default choice to the user.
    if fileExists then
    set myLogFile to open for access ((path to documents folder as text) & "Gisela'sActivityLog.txt")
    set logFileContents to read myLogFile using delimiter return
    close access myLogFile
    set lastLogEntry to last item of text items of logFileContents
    set oldTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to tab
    set lastEntry to text item 2 of lastLogEntry
    set AppleScript's text item delimiters to oldTIDs
    else
    set lastEntry to "Nothin' much."
    end if
    -- Ask the user what they're doing.
    set myLogEntry to text returned of (display dialog "So... What're you doing?" default answer lastEntry buttons {"OK"} default button "OK" with icon note)
    -- Get the date and time via "Do Shell Script" (for me, easier than mucking with AppleScript's date results).
    -- Modified order to Year Month Day# Weekday hour:min:sec [Gisela]
    set dateUnix to do shell script "date"
    set dateText to word 8 of dateUnix & " " & word 2 of dateUnix & " " & word 3 of dateUnix & " " & word 1 of dateUnix & " " & word 4 of dateUnix & ":" & word 5 of dateUnix & ":" & word 6 of dateUnix & " " & tab
    -- Open a log file on the desktop. The file is created if it doesn't exist.
    set myLogFile to open for access ((path to documents folder as text) & "Gisela'sActivityLog.txt") with write permission
    -- Write a log entry into the file.
    write dateText & myLogEntry & return to myLogFile starting at eof
    -- Close the log file.
    close access myLogFile
    -- Script by Bryan K. Vines, Corpus Christi, TX, via Apple Discussion Forum 22/5/04 and 24/5/04
    --ENDOFSCRIPT------------------------------------------
    Here's the test log => http://www.webalice.it/gisela/TestLog.txt. Had to change the name because my webspace doesn't like apostrophes (').
    This phenomenon only occurs in connection with this Activity log script. My gut tells me it's not AppleScript's fault, but I can't figure out where else to look.
    Kind regards,
    Gisela

  • How can I get Applescript to operate correctly again?

    I can't Applescript on G4 with OS 10.3.9 to work correctly. When I try to open an applescript the G4 says it can't find the Scriptable Text editor. I am then asked to choose an application but Applescript is not amoung the choices. When I close that window, the script I tried to open now opens with the script in purple (is that significant?). And icon of Scriptable Text Editor in on the desktop but when I try to open it, the program "cannot be found".
    The script I am trying to run starts out:
    tell application "Scriptable Text Editor"
    activate
    count characters of document 1
    I have some good scripts from my G3 but I can't get the G4 to open or run them. Does this mean I have to reinstall Applescript from the CD? Or should I move the script editor from the extra drive or the desktop and put it in the Applescript folder?

    HD--
    I followed your suggestion and used
    tell application "TextEdit"
    activate
    count characters of text of document 1
    end tell
    The even log came back as:
    tell application "TextEdit"
    activate
    count every character of every text of document 1
    "TextEdit got an error: NSReceiverEvaluationScriptError: 4"
    The application I am working with is Appleworks 6. I went to AW6 Text suite dictioary and found:
    AppleWorks Text Suite: Terms for use with word processing
    Class character: a character
    Plural form:
    characters
    Elements:
    character by numeric index, as a range of elements
    text as a range of elements
    Properties:
    color RGB color -- the color
    font text -- the name of the font of the character
    size real -- the size in points of the character
    style text style info -- the text style of the character
    uniform styles text style info [r/o] -- the text styles which are uniform throughout the specified text
    drawing area drawing layer [r/o] -- the character’s drawing area (only for embedded graphics)
    <Inheritance> text [r/o] -- subclass of text
    So it appears that Script Editor should recognize characters.
    There may be another glitch. When I open the downloaded Scriptable Text Editor, it opens in Mac Classic OS9. I don't know how relavent this is.
    I also checked the dictionary for TextEdit Text suite and found:
    Class text: Rich (styled) text
    Elements:
    character by numeric index, before/after another element, as a range of elements, satisfying a test
    attribute run by numeric index, before/after another element, as a range of elements, satisfying a test
    attachment by numeric index, before/after another element, as a range of elements, satisfying a test
    word by numeric index, before/after another element, as a range of elements, satisfying a test
    paragraph by numeric index, before/after another element, as a range of elements, satisfying a test
    Properties:
    <Inheritance> item [r/o] -- All of the properties of the superclass.
    size integer -- The size in points of the first character.
    font Unicode text -- The name of the font of the first character.
    color color -- The color of the first character.

  • Still no Automator / Applescript Support in iWorks 09

    Hi everybody,
    i find it extremly annoying that there are still no iWork Actions in Automator nor is there any native Applescript Support ! Come on Apple, even the bad guys at Microsoft do have Automator actions in their Office 2008 product. I bought iWork 08 i will not buy iWork 09. Am i the only person who would like to have support for automator and applescript build into the products ?
    cheers
    Ronny

    No, M$ feels they have to lead you by the hand. Apple knows there users are brighter and can do many things themselves.
    What are they going to make? How do they know what automator actions will be needed by the community until the scripting is out and available, And they see how we end up using the technology.
    Perfect example, they didn't introduce all 350+ functions available in XL in the numbers 1.0 version. They released about 150, then listened to the community to see what we wanted most. THEN they let their engineers go on those points, not WASTING their time and money creating stuff that nobody needs, or only 5% need. Now we have ~100 more functions, and even a new data type, duration, that XL doesn't have. why? because many people were trying to use Numbers to keep track of things like blood pressure logs, jogging logs, etc...
    Another real world example, college campus', Believe it or not the best designers of campuses do not put sidewalks in except for around the buildings themselves, not between them. Because they cannot predict what class patterns the students will end up having, or what habits they, as a group, will develop. They wait till about a year later, see where the grass has been worn down to paths and make sidewalks over those paths.
    This is classic design paradigms when you have a random, unpredictable user base that could require almost anything from you. Let them start by designing to fit their needs, then make official releases that take those concepts one step further and completely debugged and up to your standards.
    Just my second set of two cents,
    Jason

  • Compressor post-processing applescript and cluster

    I'm having a lot of trouble using a post-processing applescript. I have a preset that pumps out an mp3 from an hdv .mov. the post-processing script does some funky stuff and should pump out an xvid .avi. when submit the job to "This Computer" it works fine, I get the .mp3 and the script gets kicked off and generates .avi's. When the job is submitted to our cluster, however, the job fails immediately, doesn't generate either mp3s or .avi's. the log has the following:
    <----snip---->
    pid="250" msg="Hard-linked source file to cluster storage."/>
    <log tms="226012897.974" tmt="02/29/2008 13:21:37.974" pid="250" msg="Job resource error: System Error = 1 {Operation not permitted}Failed to read filethread terminated due to exception (remote exception). This is likely caused by missing or renamed watermark filter file."/>
    <mrk tms="226012897.975" tmt="02/29/2008 13:21:37.975" pid="250" kind="end" what="service-request" req-id="D729F684-764C-439E-9A06-888BB4C9405C:1" msg="Preprocessing job request error (exception=Job resource: System Error = 1 {Operation not permitted}Failed to read filethread terminated due to exception (remote exception))."></mrk>
    </logs>
    </service>
    </services>
    <----snip---->
    all requisite files have been placed on either a global filesystem (OD home directory for the post-processing script itself) or copies have been distributed to all nodes (a requisite to the applescript). The submitting user has full read/write permissions to the working dir and any subfolder.
    Any ideas?

    In case anyone runs up against this one, I found a solution/workaround. It turns out that when submitting the job to the queue, qadmin would copy the applescript over to the shared folder. During this copy, it would change attributes of the file such that the OS thought the .app was a classic application and would refuse to run it.
    Workaround: in compressor preferences, set "Cluster Options:" to "Never copy source to cluster"
    Luckily this worked for our setup as we assume all source media and scripts are already on a global filesystem.

  • Printing issue in Classic

    Hello,
    I have in the past (if I remember right) installed a Gimp driver to print with an Epson C86 printer in Classic Os9. Since the driver supplied from Epson are only available for OSX, I used the Gimp driver and it worked perfectly to print in OS9.
    I now had to replace the disposable- (that's what they have become) Printer C86 to a new C88+ but I cannot find a gimp for it. Epson is obviously washing their hands claiming that they do not support C88+ for OS9.
    Anyone knows if there's a Gimp driver (maybe a universal one) to install so I can print from OS9 with the new Epson C88+???
    and what were the step to install... to refresh my memory?
    also, where in the OS9 folder can I find where I installed the previous Gimp driver for the C86? That may help me to get started!
    thank you for your help!
    Michel

    Michel:
    Both scripts compile in my Script Editor in 10.4.3 as copied and pasted from the OS X Hints article. BUT... I did not run them myself, and have not tried the 'hint'.
    You should be using the OS X Script Editor for the job, as all the other instructions seem to be directed toward that 'environment'. The article was written in early 2005, so I assume it was based on 10.3... and there may have been changes in AppleScript between 10.2 and 10.3. By the way, the 'hint' is for printing from Classic within OS X... not for printing from a straight boot on OS 9.
    The only other thing I can suggest is that the copy / paste from the article resulted in a line ending error (or somesuch). You might just try again... or try from another browser, if you're having problems with Safari.
    I have the opposite problem to yours at the moment - a printer with Classic drivers only, with limited ability to print from OS X... even with foomatic, et al.
    Good Luck.
    Peter B.

  • FileMaker Pro 3.0 in Classic

    Dear all,
    Before OS X, I used some Filemaker databases which I made myself, but evolved a lot after years of use. I never needed to upgrade beyond FM Pro 3, because simple relational databases where good enough for the job. The power of FM over apps such as Access and others where ease of use, customizability and price. Now when I try to use FM under Classic, it really stinks; Due to enormeous typing delays letters would be typed a few times until I turned off typing repetition of letters. Now I can type normally, but with a delay of a few tenths of a second. Typing in my favourite database program has become virtually impossible (rendering the database program very useless).
    As I m stuck with all those pretty and very functional databases I m looking for a way out. I m not willing to pay 500€ for FM Pro Professional. Is there a way to convert existing FM Pro databases to another (cheap) alternative? What alternatives offer similar ease of use as FM Pro? I use a lot the repetition of field inputs; the scriptability (both within the program as to external programs using Applescript); simple relational lookups; and of course the drag-and-drop page layouts. Or is there a way to improve the behaviour under Classic? Or perhaps a simple shareware that performs FM Pro tasks?
    I m pretty sure my other OS9 programs work slower under Classic than under OS 9, but this one is really stuck compared to e.g. Photoshop.
    I will have a lot of database work to do before the end of the year, hence the question.
    Thanx,

    I don't know about other things using FileMaker files but if you do use many scripts, I bet that won't be easy…
    However, if you can find one somewhere like e-Bay, FMP 5 can read 3 files, works perfectly in Classic and includes installers for 9, X and even Windows on the same disk.
    If it matters, I seem to remember the reason my FMP files are now stuck with single-user access instead on networking is that networking late X with Windows requires FMP 6… and presumably, that doesn't much matter.

  • Applescript in Leopard

    Good Afternoon All!
    I'm trying to use the fscommand in a flash projector file.
    Before Leopard came along I used the code below to launch pdf
    files. Now that I have Leopard installed I get an error box stating
    that the classic code is no longer supported. Can anyone help me
    with some new code to launch pdfs in the mac environment please?
    .......................................................................................... ........................

    You can try here:
    http://www.apple.com/applescript/
    and here:
    http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptLangG uide/
    Message was edited by: lethal

  • Can't open application because the Classic environment on longer supported

    I created a droplet on my 2013 Macbook Pro and emailed it to My 2013 Macbook Air, both are running Maveriks. On the Air the app is locked and says "Can't open application because the Classic environment on longer supported"

    Try: open the droplet in AppleScript Editor and re-save and email again (edit: right-click the droplet and select "Compress" as Frank suggested).

  • Classic programs installed as admin

    Hi everyone, new poster here. Anyways, I am in the process of setting up 10 new mac OS X comps at the school I work at. We have had a bunch of OS 9 comps ion each classroom and the teachers want to be able to use their current software. So, I installed the OS 9 software when logged in as admin. When I switch to the 'student' account, many of the programs fail even though they worked fine as admin. Any ideas?? I also want to set up the studetn account as 'simple finder.' I don't have the time for tech support in each classroom so the more security on each comp, the better. I appreciate your help.

    Although I haven't encountered any myself, I get the impression that some old Classic applications just don't work very well with a multi-user arrangement. One thing that often helps in allowing the use of Classic programmes to proceed more smoothly is to select the option configuring Classic to use preferences from the user's "home" folder ("System Preferences" > "Classic" > "Advanced" > "Use Mac OS 9 preferences from your home folder" (this should be set while logged in to the "student" account).
    Another issue is that some programmes (eg. AppleScript apps that contain modifiable "properties") may have to have the permissions of the actual application modified so that the prosepective user has "write" access.
    Just a note regarding "Simple Finder" - be aware that unlike a "Some Limits" account, "Simple Finder" does not actually prevent the user from using programmes that haven't been selected.

Maybe you are looking for