HELP : APPLE SCRIPT ISSUES!

I am trying to make an apple script that will detect when an application (minecraft,cod or other online downloaded software/games) is open and then bring up a dialog that wont go away so that only I.T. can remove it. I also want it to send an email to a certain adress saying that so and so has been playing games
It's a school project that im working on, we have to figure out a way (through applescript) to help students be more productive, everyone else has no experience with apple script but me. I managed to create this in a couple of minutes but there is a couple glitches and problems i cant solve.
the problems include
it doesn't work with non-appstore apps ie. apps downloaded for the internet
i want it to be able to detect numerous programs
it doesn't close the program and/or bring the window/dialog to the top.
I have used safari as an example as to where a list of "illeagle apps" should be.
here's the script:
tell (get system info)
          set longName to long user name
          set shortName to short user name
end tell
if appIsRunning("Safari") then
          tell application "Mail"
                    set theNewMessage to make new outgoing message with properties {subject:"[" & longName & "] ,Gaming Alert", content:"[" & longName & "] has been gaming, he is to report to I.T. by the end of the day", visible:true}
                    tell theNewMessage
  make new to recipient at end of to recipients with properties {address:"[email protected]"}
  send
                    end tell
          end tell
end if
end
repeat
          if appIsRunning("safari") then
                    display dialog "Gaming is not allowed, Your log of your computer programs running has been emailed to the I.T. department. Please visit the I.T. department immedietly to remove this message" buttons {"Report To I.T."} default button 1 cancel button 1 with title "Gaming Alert" with icon stop
          end if
end repeat
if appIsRunning("safari") then
          tell application finder
                    quit appIsRunning("safari")
          end tell
end if
on appIsRunning(appName)
          tell application "System Events" to (name of processes) contains appName
end appIsRunning
end
Any help is greatly appriciated
Thanks! 

I really do not appreciate your negativity towards this assignment.
firstly i am not trying to "cheat" the system by asking for help, our teacher encourges us to go online , reserch and go onto forums such as these.
Secoundly , I dont need you to criticize my idea's by telling me that i am a "taddle tale" or whatever
Thirdly , it's called updating over wifi. Thats how I intend on updating the blacklist to new games
Finally it will encourage student productivity, as without games there will be no distractions. Internet games and such are blocked and I plan to keep my identity, as the creator of the script , a secret
And also, here's a bit of criticism maybe you would be a better educationalist yourself if you actually encouraged a project.
Ps. Are you familiar with google science fair... if not LOOK IT UP!
im going i have talked viney kumar and are most likley teaming up to put this project in action, we go to the same school. He thinks it is a good idea and if YOU ever had any idea's at all that aren't criticism maybe you would have at least one atom that is up to his standard of innovation.bye the way, i am only 14.What were you trying to do when YOU were 14...
Signed
Steves Assistant

Similar Messages

  • PLZ HELP SAP SCRIPT ISSUE (DYNAMIC BOX)

    Hi all
    I want to include a dynamic text (means number of lines can vary) inside a box .
    please guide me how i can create this box whose size would be dynamic according to this text.
    plz help i am not able to find ne solution
    Thanx in advance
    Edited by: SARABPREET CHADHA on Mar 14, 2008 11:33 AM

    Following things to be done in Driver program.
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
          ID              = TEXT_ID
          LANGUAGE        = PRINT_LANGUAGE
          NAME            = TEXT_NAME
          OBJECT          = TEXT_OBJECT
        IMPORTING
          HEADER          = TABLE_HEADER
        TABLES
          LINES           = TABLE_LINES
        EXCEPTIONS
          ID              = 01
          LANGUAGE        = 02
          NAME            = 03
          NOT_FOUND       = 04
          OBJECT          = 05
          REFERENCE_CHECK = 06.
    then
      CALL FUNCTION 'WRITE_FORM_LINES'
        EXPORTING
          HEADER    = TABLE_HEADER
          WINDOW    = WINDOW
        IMPORTING
          FROMPAGE  = FROMPAGE       " not interested ?
        TABLES
          LINES     = TABLE_LINES
        EXCEPTIONS
          FUNCTION  = 01
          TYPE      = 02
          UNOPENED  = 03
          UNSTARTED = 04
          WINDOW    = 05.
    and then in sap script.
    /:           INCLUDE &THEAD-TDNAME& OBJECT &THEAD-TDOBJECT& ID &THEAD-TDID&
    /:           PARAGRAPH T6 LANGUAGE
    Your text will apper in sapscript.
    Award points if useful...

  • Speech Recognition Apple-Script Issue

    I am personalizing the apple speech recognition program but I stumbled upon this problem. If I type in <pre class=command> at the beginning of the script I get a synatax error saying the '<' can't go there. Either I'm making a simple mistake or its buggy.

    The problem appears to be a forum response that included HTML along with the AppleScript code.  PRE is an HTML command.

  • Help Needed with Apple Script

    I need a little help with Apple Script. I have been using a script for several months now, and all of a sudden it just stopped working. Here's the script"
    ============
    with timeout of 9999 seconds
    tell application "Finder"
    activate
    (* copy target file to another disk - to create a backup *)
    duplicate file "Daily.dmg" of folder "File Backups" of disk "HD Mirror" to folder "Data Backup-Daily" of disk "MacHD 1" replacing yes
    (* copy a 2nd target file to another disk - to create a backup *)
    duplicate file "Personal.dmg" of folder "File Backups" of disk "HD Mirror" to folder "Data Backup-Daily" of disk "MacHD 1" replacing yes
    (* now copy the 2nd target file to my iDisk *)
    duplicate file "Personal.dmg" of folder "Data Backup-Daily" of disk "MacHD 1" to folder "Documents" of disk "xxxxxx" replacing yes
    end tell
    end timeout
    ============
    In the above script, xxxxxx represents the name of my iDisk that is mounted in the Finder.
    Here's my issue - the above script worked fine until just recently. However, now the first two steps work fine, but I get this error message while trying to copy the file to my iDisk:
    "The operation could not be completed because some items had to be skipped. 'Personal.dmg'"
    Does anyone have any ideas on how I can fix this? I'm wondering if Mac OS 10.4.5 might be the culprit since this problem seems to have occurred shortly after I upgraded???
    Thanks,
    -AstraPoint

    Hi,
    Assumptions :-
    uuencode command exits
    mailx command exits
    File name is "vas.txt".
    Mail id is "[email protected]"
    # START OF SCRIPT
    #!/bin/ksh
    vasFileName="$1"
    vasRecordsDirFile=/etl/dev/work/wellness/enrl_rej/records/${vasFileName}
    vasMetatdataDirFile=/etl/dev/work/wellness/enrl_rej/metadata/${vasFileName}
    vasHeaderDirFile=/etl/dev/work/wellness/enrl_rej/header/${vasFileName}
    vasHeaderRejDirFile=/etl/dev/work/wellness/enrl_rej/hdrrej/${vasFileName}
    vasFieldsDirFile=/etl/dev/work/wellness/enrl_rej/fields/${vasFileName}
    if [[ -e ${vasRecordsDirFile} ]]
    then
    uuencode ${vasRecordsDirFile} ${vasRecordsDirFile} | mailx -s "process complete and attached are the rejected records" [email protected]
    elif [[ -e ${vasMetatdataDirFile} ]]
    then
    uuencode ${vasMetatdataDirFile} ${vasMetatdataDirFile} | mailx -s "Metadata Mismatch no of fields in detail didn't match" [email protected]
    elif [[ -e ${vasHeaderDirFile} ]]
    then
    uuencode ${vasHeaderDirFile} ${vasHeaderDirFile} | mailx -s "Problem with header file - File Rejected" [email protected]
    elif [[ -e ${vasHeaderRejDirFile} ]]
    then
    uuencode ${vasHeaderRejDirFile} ${vasHeaderRejDirFile} | mailx -s "the Percentage of rejects more than 3 percent File rejected" [email protected]
    elif [[ -e ${vasFieldsDirFile} ]]
    then
    uuencode ${vasFieldsDirFile} ${vasFieldsDirFile} | mailx -s "The header and detail count didn't match File rejected" [email protected]
    else
    echo "File doesn't exist in any of the directories mentioned."
    fi
    # END
    Vijay Bheemineni.

  • APPLE SCRIPT HELP! Simple Renaming Script

    I dont have any experience with apple script but desperately needed this for a work issue. I basically have tons of files with all the same type of name and need to send the first two numbers in the file to the end of the file as a suffix... so this...
    01 alexa_02.mp3
    needs to turn into this
    01 alexa_02_01.mp3
    So the function is take the first two characters from the file name of all the files in the folder and rename them with a suffix. Here is what I have so far.
    PLEASE HELP! Im desperate!
    [CODE]try
        tell application "Finder" to set the source_folder to (choose folder with prompt "Pick the folder containing the files to rename:") as alias
    end try
    display dialog "Change Suffix to First Two Characters of File Name:" buttons {"Send The Pids!", "Cancel"}
    set the button_pressed to the button returned of the result
    set the item_list to list folder source_folder without invisibles
    set source_folder to source_folder as string
    repeat with i from 1 to number of items in the item_list
        set this_item to item i of the item_list
        set this_item to (source_folder & this_item) as alias
        set this_info to info for this_item
        set the current_name to the name of this_info
        tell application "Finder"
            if the button_pressed is "Send The Pids!" then
                set the filename to the (current_name & the characters 1 thru 2 of current_name) as string
                set orig to quoted form of POSIX path of current_name
                set dest to source_folder & filename
                try
                    set y to dest as alias
                on error
                    set dest to quoted form of POSIX path of dest
                    set command to "mv " & orig & " " & dest
                    do shell script command
                end try
            end if
        end tell
    end repeat[/CODE]

    Made a short script on my own... normally you could do this using the Finder and run a recursive algorythm, but if you just use find to find all files in a folder that ft your criteria and use these links to generate a list of aliases (posix files) it is way faster and acomplished with less code :-)
    set myfolder to characters 1 through -2 of (POSIX path of ((choose folder) as alias)) as text
    set foundfiles to every paragraph of (do shell script "find " & quoted form of myfolder & " -type f -iname \"*.mp3\"")
    repeat with afile in foundfiles
    set afile to ((afile as text) as POSIX file as alias)
    tell application "Finder"
    set filename to name of afile
    set filesuffix to (characters -4 through -1 of filename) as text
    set addonsuffix to characters 1 through 2 of filename
    set filename to (characters 1 through -5 of filename) as text
    set newfilename to filename & "_" & addonsuffix & filesuffix
    set name of afile to newfilename
    end tell
    end repeat

  • Help creating apple script to create folder and set access levels

    I'm trying to create folders in FileMaker Pro using apple script and need some help in setting the access level for the folders.  I want to set both Staff and everyone to Read and Write access.   Secondly I would like to have a function key set on the desktop to create new folders and set that same access level.  The default access is Read and I can not find a way to change that.
    Thanks

    I'm trying to create folders in FileMaker Pro using apple script and need some help in setting the access level for the folders.  I want to set both Staff and everyone to Read and Write access.   Secondly I would like to have a function key set on the desktop to create new folders and set that same access level.  The default access is Read and I can not find a way to change that.
    Thanks

  • Please help!! Using Apple Script in Automator for Quicktime

    I would like to add some metadata to a batch of quicktime movies and then make the files unable to be altered and re-saved so that I can post them on the web. If I open a movie in quicktime and run the following apple script I can then perform save as of movie A into movie B and movie B cannot be altered.
    tell application "QuickTime Player"
    set saveable of movie 1 to false
    -- save self contained
    end tell
    I would love to be able to do this on a batch level in automator however I cannot figure out how to pass automator items to the apple script so that their saveable can be set to false, and after this I cannot figure out how to have to movies re-saved so the changes will take effect.
    Any help at all would be greatly appreciated.

    how are you passing files to apple script? as finder items?
    the following should work then
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #ADD8E6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    on run {input, parameters}
    tell application "Finder"
    repeat with cur_file in input
    set fname to (name of (get info for cur_file) as text)
    tell application "QuickTime Player"
    open file (cur_file as text)
    set saveable of document 1 to false
    tell application "Finder" to set new_item to (path to desktop as string) & fname
    save self contained document 1 in new_item
    delay 1
    close document 1
    end tell
    end repeat
    end tell
    end run
    </pre>
    the above will dump the modified files onto your desktop and give them the same names they had before. You can adjust that as you like of course.

  • Help with moving contact info using Apple Script in Address Book

    Hi folks,
    I wonder if someone can help? I imported a few hundred contacts via a Gmail created vCard into my Address Book. The problem is that instead of inserting the email addresses into one of the email fields for each record, it has inserted the email address into the Notes field as follows: "EmailAddress: [email protected]".
    I would like help to write an Apple Script that will search my contacts in Address Book, find those with "EmailAddress:" in the notes field, cut the email address that follows it, and pastes it into the Work Email field, carries out the operation for the whole address book and saves the changes.
    Can anyone help me write a script for this. I've not used Apple Script before so this will be my first attempt!
    Thanks in advance,
    ayworld

    This should work:
    tell application "Contacts"
      activate
              set thePeople to every person whose note contains "EmailAddress:"
              set {oldTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ":"}
              repeat with thePerson in thePeople
                   set nn to thePerson's note
                    make new email at end of emails of thePerson with properties {label:"Notes", value:text item 2 of nn}
              end repeat
      save
    end tell
    It will leave the entry in notes and make the label of the new email 'Notes"
    Normally when I post an AppleScript like this I tell the user to test it out before using it on the actual data but in this case I don;t know how you'd do that given there is only one Contacts and only one Contacts database.
    Just make sure you have a backup just in case. I tried it here on some dummy entries in my Contacts and it worked OK.
    Again this totaly relies on the data you presented. The Notes field has to be in the format
    EmailAddress:[email protected]
    for this to work.
    regards
    Message was edited by: Frank Caggiano - If you select all the text in the box, then right click and select Make new AppleScript the script will open in the AppleScript editor. Just make sure you get all the text it is easy to drop the first or last char when selecting.

  • Help with Apple Script Code

    Hi,
    I found this Apple script online and here's how it works:
    tell application "QuickTime Player"
    activate
    try
    if not (exists document 1) then display dialog "Please open a QuickTime movie." buttons {"Cancel"} default button 1 with icon 1
    set thefile to (choose file name)
    save document 1 in thefile
    close document 1
    end try
    end tell
    +I run the Apple script+
    *1. It prompts me to open a movie file in Quicktime*
    +I open a movie in Quicktime+
    *2. It prompts me for an name and directory to save the new file in*
    +I enter a name and directory+
    *3. It saves a new reference movie in said directory with said name*
    This is useful if I want to customize every file, but unfortunately, I just want to mass create reference movies for a whole bunch of files.
    What I am looking for is for an Apple script that is a drag and drop application, so I can drop say 100 movie files or so, and have the Apple script create reference movie files with the same name and in the same directory automatically with no prompts.
    Since I am unfamiliar with Apple script I was wondering if someone would be able to edit my existing script to do what I want.
    Thanks so much for your help!

    Use Automator. It's great for repetitious tasks (like the one you've described), and it's very user-friendly. Open Automator, create a new workflow that executes the action you want, and you can apply that action to the resources you wish to edit.
    Good resource here:
    http://bit.ly/

  • I've used for months but am now so frustrated with the script issue I have uninstalled until I get some resolution. Help?

    I've to change the 10 to 20 solution to help solve the unresponsive script issue. I've tried safe mode. I've tried disabling all add-ons but still have it hang up. I don't seem to face that issue with explorer. Is microsoft sabotaging your efforts?

    Did you also try to disable all plugins?
    See [[Troubleshooting plugins]]
    Create a new profile as a test to check if your current profile is causing the problems<br />
    See [[Basic Troubleshooting#Make_a_new_profile|Basic Troubleshooting&#58; Make a new profile]]
    There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins"
    If that new profile works then you can transfer some files from the old profile to that new profile (be careful not to copy corrupted files)<br />
    See http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • HT1770 I am setting up new Seagate GOFlex Pro for Mac for Time Machine.  Backup stops at 45.2MB.  A customer service of the Seagate said it is Apple's issue.  Please help!  Shuichi

    Backup stops at 45.2MB.  A customer service says that it is Apple's issue.  Please help.  Shuichi

    Event store UUIDs don't match  naming your internal HD or any other drive/partition being backed-up.  Time Machine can't be sure the OSX internal log of file changes that it normally uses is correct. 
    This happens in the following circumstances:
    •The first backup of a disk, or to a new location
    •After booting from your install disc, Recovery HD, or a different OSX volume (usually)
    •A full restore
    •Certain hardware repairs (e.g., new internal disk or logic board)
    •Removal of large exclusions
    •A very large volume of changes (especially an OSX update)
    •An improper shutdown of your Mac, or improper disconnection or power loss on the Time Machine drive
    •If it's an external HD, an improper shutdown or disconnection of the drive
    •A failed or cancelled backup
    •Many days without a backup
    It usually causes a lengthy deep scan/traversal (below), so if you see it frequently, you need to figure out why it's happening.
    http://pondini.org/TM/A6.html
    Might also have a look at...
    /Library/Logs/CrashReporter/backupd_2013-11-15-164711_NAME-nokonpyuta-2.crash

  • Auto refresh with apple script- help please

    can any one help me please
    i use multiple windows in safari at one time and can any one help me to refresh these pages (two windows) automatically using apple script.
    also if I click manually to refresh these pages i get the following note"
    "To open this page again, Safari must resend the form you completed to open the page the first time. This may cause the website to repeat actions it took the first time you sent the form."
    and i have click send for this to happen
    any help from you all will be appreciated as this will help me a lot with the present work that i am doing

    Not sure about the "automatic" reload - Opera allows you to set a refresh time interval for each tab, but not Safari. Also, Safari Extender gives you a single click contextual menu option to "reload all tabs".
    here is an AppleScript for a one-page auto reload. You might be able to alter the script to auto reload all open tabs.
    Not sure about the "warning" message. Can you post a URL so I can have a look?

  • Apple script to open Outlook 2011 issues

    Hello,
    I am trying to write a apple script to launch some applications in bulk, not necessarily always at startup. The application I am having trouble with is Microsoft Outlook because it brings a pop up window asking if I want to turn on office reminders. I of course want to turn them on, can I set the apple scrip to click the turn on button? And can I set the apple script to make sure on startup the reminders are turned on each time I start Outlook. Your help is much appreciated.

    Hello,
    I am trying to write a apple script to launch some applications in bulk, not necessarily always at startup. The application I am having trouble with is Microsoft Outlook because it brings a pop up window asking if I want to turn on office reminders. I of course want to turn them on, can I set the apple scrip to click the turn on button? And can I set the apple script to make sure on startup the reminders are turned on each time I start Outlook. Your help is much appreciated.

  • Can anyone help with this issue.... intermittent sound from apple tv

    Can anyone help with this issue?..watched the trailer of a movie with sound, then downloaded and went to watch it, but no sound and this message was displayed:"an incompatible audio signal has ben received.check the output device" tv is a sharp aquos

    I don't know if this will help but have you tried switching the audio output to 16-bit? On the AppleTV, click Settings, Audio & Video, Audio Output. The two choices are "auto" and "16-bit". Good luck!

  • Looking a Apple Script please Help !

    I am looking for a Apple script which I start the Mac App Store and dirket jump to the updates. Is that possible?  If so  can i combine that  with the Automator on Mac ?

    Can you post more information?
    What happens when you type "python script.py"?  Do you get some sort of error message?
    If you type only the name of the script then you will have to make sure you have changed directory to where the script is located first. For example if your script is saved to your desktop, when you start Terminal you will first need to do "cd ~/Desktop" to change directory.
    Or alternatively you could type the path to the script:   python ~/Desktop/script.py
    Steve

Maybe you are looking for

  • Can i load cc software on more than one computer?

    I have a subscription to Adobe CC for my home iMac and I'm wondering if I can load the software on my laptop in addition to my home computer?

  • How to get the list of documents

    Hi everyone Can anyone help me How to get the list of documents residing in a folder of KM repository of SAP Netweaver using a simple java program Thanks in ADV. Rupesh Khemka

  • Want to fill Nano w/ songs, not albums

    I've got a 2GB Nano that I'd like to fill with a random selection of songs from my iTunes library (>25GB). When I let iTunes create a random playlist from the library, it grabs full albums that I have ripped over (+ whatever singles I have purchased)

  • Comercial rounding in FI Service Tax Calculation

    Dear All, We are in Implemantation project, we done the configuration for Service Tax From FI, system is calculating the persentage but my issue is ........ My client wants the rounding values in tax line items Ex ; if my tax line item is having 10.4

  • Contact Pictures Gone Too?

    If I remove the pictures from my iphone that I have chosen to use for my contact pictures will the contact pictures be gone too?