Applescript and automator

I have studyed html for 3 days and wordpress for 3 days , word , excel for 5 days, and llustrator and photoshop 13 yeas ago for 6 months.
and still now its so hard to understand some how.
but I am in need of understading now with the printed documents from my computer.
and I wonder , so there are many defferent way to communicate with anyone out side of the world, right?
like I know email , fax, facetime,
but there are other way now I think because of the documents I found.
and also with applescript and automator can do anything possible like even the child can click one and start conecting etc..
I have the copy from its ,
does anyone have time to explain me what it is?
It's not that of teenager who doesn't want paretns to know or else,
but I am quite serious for my situations.
Please Help !
Mac OS snow leopard to lion to moutain lion,,,,,
but I don't know when it started yet.

Using JavaScript to script System Events wouldn't be any better, since it uses the same Apple Events mechanism (how well it uses it is another topic).  To hold down a key you would need to use something that has access to the deeper system APIs, most likely using Xcode.
And yes, your code snippet will press the arrow key 5 times (I am guessing that the missing space in key code is a typo).  You can place the cursor in a bunch of text in another application such as TextEdit, and use your script to activate it before performing the key codes to get a better idea of what is happening (trying to reposition the cursor in the Script Editor will reveal a bug with the delay command).

Similar Messages

  • IWeb Applescript and Automator - scripts you shouldn't be without

    Applescript and automator will automate mundane manual repetative task that seem to take forever. These scripts fill in iWeb's void that makes it hard to implement advance features such one click ftp publishing, code editing, swithching domain site files, etc. Don't miss out on these scripts that will save you ton of time. These are scripts you shouldn't be without.
    Work smarter not harder with iWeb applescript, only from MacEzzy.
    -- Also check out the free downloadable iWeb templates.
    Powerbook G4 Ti   Mac OS X (10.4.4)  

    Thank you for your feedback.
    -- Article never mentions compressed or uncompressed. Traditionally tiff format is used for buttons and small images on web pages and jpeg is used for higher quality photos exemplified by iWeb.
    -- Search engine spiders or crawlers start from top of the page to the bottom of html pages. They craw for topic as well as content. This is exactly what appears from iWeb html pages for meta (meta name="Generator" content="iWeb 1.0.1")
    -- I am the first to admit I don't know everything but I don't make up information. I use iWeb on a daily bases and try new things to push the envelope. Things that I find helpful to me I make it available for other iWeb community users so that they don't go through tribulation.
    -- I put google ads and paypal donate buttons throughout the pages to test if iWeb is up for commercial challenge. I also tested how well the search and replace script worked. I have exemplified in macezzy website it is possible to use iWeb for business purpose. The script worked extremely well, it would have taken hours to insert google and paypal codes manually. Using the script it only took 10 min. I wanted to share that with other users who might wanted to do similar things. Sorry if that offend you, I will remove them.
    -- I never claimed to have created the script except the script that makes the first folder in documents folder. I did change the wording so that it is clear to users that they are switching sites(domain file). I did not create the awesome search and replace script either. I do mention that I have made the iWeb_ftpUpload automator.
    I have started macezzy site when iWeb was introduced and there wasn't much information about iWeb. I have and do try many things with iWeb and report to iWeb community users of things that I find helpful. I haven't made a dollar off the site and I have invested lot of my time because I like to see other users succeed.
    Powerbook G4 Ti   Mac OS X (10.4.4)  

  • Using Applescript and Automator to manage files and folders

    Hi all.
    I need to make a simple action via applescript and-or automator to take the file it's been applied to (via the services) create a folder around it with the same name as the file.
    So far, I've searched the web, found some solutions but none are really working.
    Here's the script I found :
    set myFolder to findFolder()
    tell application "Finder" to set myFiles to files of myFolder as alias list
    repeat with aFile in myFiles
      set bName to my baseName(aFile)
      tell application "Finder"
      set folderExists to exists folder bName of myFolder
      if not folderExists then make new folder at myFolder with properties {name:bName}
      move aFile to folder bName of myFolder
      end tell
    end repeat
    ---------------- HANDLERS ----------------
    on baseName(myFile)
      tell application "System Events" to set {fileName, fileExt} to {name, name extension} of myFile
      return text 1 thru ((get offset of "." & fileExt in fileName) - 1) of fileName
    end baseName
    on findFolder()
      activate application "SystemUIServer"
      -- Bug pointed out by Lauri Ranta http://www.openradar.me/9406282
      tell application "Finder"
      activate
      set mySelection to (get selection)
      if mySelection ≠ {} then
      set mySelection to first item of (get selection)
      if mySelection's class = folder then
      set currentFolder to mySelection
      else if mySelection's class = document file then
      set currentFolder to parent of mySelection
      else if mySelection's class = alias file then
      set currentFolder to original item of mySelection
      end if
      else
      set currentFolder to target of front Finder window
      end if
      end tell
      return (currentFolder as alias)
    end findFolder
    And here's a page where they explain how to use automator and the Services to do what I <allmost> want, with some adaptation.
    But it still doesn't work.
    http://hbase.net/2011/08/17/move-selected-files-into-a-new-folder-using-applescr ipt-and-automator/
    So if anybody has an idea n how I could do this ?
    It It could either be a folder action (I drag and drop the files into a folder and boom, they get their folder around them)that I would set on a folder on a network drive, or locally, it doesn't matter, or a service (right clic on the file and boom folder around it.
    So if anyone could help with this I'd be grateful...

    Hi,
    Make an Automator Service (Service receives selected "Files or Folders"  in the "Finder.app").
    Use this script in the "Run AppleScript" action:
    on run {input, parameters}
        tell application "Finder"
            repeat with aFile in input
                if class of (item aFile) is not folder then
                    set {tName, fileExt} to {name, name extension} of aFile
                    if fileExt is not missing value and fileExt is not "" then
                        set tName to text 1 thru -((count fileExt) + 2) of tName
                        tell (get container of aFile)
                            if not (exists folder tName) then make new folder at it with properties {name:tName}
                            move aFile to folder tName
                        end tell
                    end if
                end if
            end repeat
        end tell
    end run
    This script work on files with a name extension.

  • Alternatives to AppleScript and Automator?

    AppleScript is so hard to use. Why has Apple let it languish, so utterly broken and hard to use? Is something coming around the bend and they prefer to replace it rather than patch it? Do we need to wait for OS 11?
    + iTunes 10 won't run any scripts, claiming I need iTunes 2.0.3, the old string comparison for version number bug. Sure one can hack the number but that's honestly not the right answer.
    + Automator doesn't accept variables, which requires a hack for editing the UUID in the XML form of the workflow.
    + Dictionaries and the bizarre and inconsistent COBOL-like syntax for object access are just too wild to grok. Hence these forums for constantly full of real people asking for advice, that is to say they want someone to write it for them. And who can blame them?
    I've read Neuberg's Definitive Guide, which just makes me laugh as I get the picture of a language for which excuses must be made every few pages. Despite matt's excellent wring and research, the subject is so twisted he can't convey a consistent mental model. AppleScript is just failed tech which only a few fans "get". I grok everything from LISP to TCL, but AppleScript is just a disaster, a mess.
    Sorry, I just needed to vent. This isn't a troll for defensive reactions. I would appreciate sympathy and alternative ideas for AppleScript. Can I learn some other language that uses Apple Events in a saner fashion? (Apple Events may in fact be part of the problem too, I know.) Will these work in every place AppleScript is accepted (iTunes script menu, Services plug-ins)?

    You will get arguments from both sides, but AppleScript is far from broken - weird perhaps, but it does get changed and updated for each OS version. There are a few AppleScript forums such as macscripter.net to help you figure out it's quirks, but I don't see it being replaced anytime soon.
    + I don't run iTunes 10, but that particular bug doesn't have anything to do with AppleScript itself, just the way the version number gets looked at.
    + Automator does use variables, but the particular action needs to be written to use them - Apple is being a bit slow to update a lot of it's included actions, but you are welcome to write your own or use a third party action. There are also actions that will let you run a shell script such as bash, Python or Ruby.
    + You won't get any argument from me about the scripting dictionaries, although those are written by the particular application developer.
    You definitely do not need to use AppleScript, so if you are looking for something other than a compiled language such as Objective-C or C/C++, there is perl, Python, php, tcl, and Ruby, in addition to the command line shells such as bash, ksh, zsh, and tcsh. Apple events are what is ultimately used by any scripting language to control the various applications - for an Apple-Event bridge, you might take a look at appscript.

  • AppleScript and Automator forums

    I was trying to help someone who wanted to do the same thing to hundreds of files and my thought was to suggest either Automator or AppleScript to them. These technologies seem related to me. Anyway, the AppleScript forum is under "Mac OS X Technologies", the Automator forum is under "Mac OS X v10.4 Tiger". I would expect to find these technologies together, AND if there is an Automator forum under Tiger, I'd expect to find one under Leopard as well. I know there was some talk about reorganizing the forums, I wanted to mention that this seemed confusing to me.

    I believe csv files are just plain text files in which case what you want can be easily done with a shell script.
    the following terminal command will take the contents of file1.csv and write every even line to file2.csv
    cat path/to/file1.csv | sed -n '2,${p;n;}' > path/to/file2.csv
    You need to put the paths to the files in question in the above.
    for example if those files are located in your Documents folder the command would be
    cat ~/Documents/file1.csv | sed -n '2,${p;n;}' > ~/Documents/file2.csv
    You can put it inside an automator workflow using run shell script action.
    If you want odd rather than even lines change the command to
    cat path/to/file1.csv | sed -n '1,${p;n;}' > path/to/file2.csv

  • Applescript and Automator Issue

    Hi all,
    I'm trying to design an Automator and Applescript code that will perform the following.
    1. Target specified application and make active
    2. Hold down s key for 15 seconds
    3. Hold down the left arrow key for 0.75 seconds
    4. Hold down s key for 15 seconds
    5. Hold down right arrow key for 0.75 seconds
    6. Repeat this 100000 times.
    The code I have developed is as follows:
    activate application "MyApplication"
    repeat 1000000
    tell application "System Events"
         key down (key code 1)
         delay 15
         key up (key code 1)
    end tell
    tell application "System Events"
         key down (key code 123)
         delay 0.75
         key up (key code 123)
    end tell
    tell application "System Events"
         key down (key code 1)
         delay 15
         key up (key code 1)
    end tell
    tell application "System Events"
         key down (key code 124)
         delay 0.75
         key up (key code 124)
    end tell
    The problem is that this program is recognizing the key codes all wrong. The key code 1 refers to my "a" key when it should be referring to "s". Key code 123 and 124 don't do anything. Is there something wrong with my code? Help would be appreciated.
    Thanks

    Using JavaScript to script System Events wouldn't be any better, since it uses the same Apple Events mechanism (how well it uses it is another topic).  To hold down a key you would need to use something that has access to the deeper system APIs, most likely using Xcode.
    And yes, your code snippet will press the arrow key 5 times (I am guessing that the missing space in key code is a typo).  You can place the cursor in a bunch of text in another application such as TextEdit, and use your script to activate it before performing the key codes to get a better idea of what is happening (trying to reposition the cursor in the Script Editor will reveal a bug with the delay command).

  • IMovie 08 slideshow infinite loop - with Applescript and Automator?

    As many people I try to use iMovie for a slide show with an infinite loop. But there is no button inside the program for it. I don't want to export the project to use the loop function of Quicktime. Because that means compression of the slide show photos - Export with Quicktime: H.264, Best Quality.
    I already compressed the photos with JPG in High Resolution (Photoshop) and dropped them into the project. The result of double compression is not fine (enough). And the amount of data increases.
    So I tried to program a short Applesript for an infinite loop in iMovie. First it seemed to be very simple. iMovie "cmd g" starts the fullscreen presentation of the project. At the end you press "spacebar" and it runs again.
    (Finder object)
    tell application "System Events"
    tell application "iMovie" to activate
    keystroke "g" using command down
    end tell
    (Pause)
    tell application "System Events"
    tell application "iMovie" to activate
    keystroke "space bar" (or "arrow left"?)
    end tell
    (infinite loop)
    Unfortunately it didn't loop. At the end of the presentation the screen remains black. Only a beep signals that the Applescript pressed the spacebar. What did I wrong?
    In some groups people say it's impossible to program a script for iMovie because it does not support Applescript.
    Blackletter

    I made a simple mistake in the code.
    wrong:
    keystroke "space bar"
    right:
    keystroke space
    Now the infinite loop runs in iMovie!

  • Applescript and Automator HELP!!!

    I have changed an application's Info.plist file to make it hidden form the dock and finder, using automator a series of actions complete. After these I want to make the applications window which is currently showing on the desktop to be hidden, however I can't seem to use commands due to this application being hidden from finder. Thanks.

    I have changed an application's Info.plist file to make it hidden form the dock and finder, using automator a series of actions complete. After these I want to make the applications window which is currently showing on the desktop to be hidden, however I can't seem to use commands due to this application being hidden from finder. Thanks.

  • AppleScript (or Automator?): How to search through online сhеss games?

    Hello.
    I would like to search for specific online сhеss games. Each game has a single adress. We are talking about millions of games. Obviously, it's far too long to index all the games. So I will set a limit and use the script at night. Conditions should be something like this:
    For adress example.com/game=NumberA to example.com/game=NumberB
    Search every web page containing SpecificWord
    Store wanted web adresses somewhere (so I could see the games by myself during the day)
    As you can see, I know nothing about Applescript and I don't know how to start, nor how the script can pick up adresses. I think it's possible and not difficult to code, just time consuming for the program to search through thousands of games.
    Should I use AppleScript or Automator? Should the script open Safari (or Firefox if possible) or can it search without any browser? Is it possible to simultaneously search through multiple pages/adresses? Maybe I could write several scripts for different ranges of games? If so, how many pages can I open at once? For instance I could disable images in Firefox to load quicker. How much time does it need to search for one game? 1, 2, 3, 4, 5 seconds?
    Any easy tutorials, examples of similar codes, advices, hints or tips are appreciated.

    Thanks for answering. Sorry that I was so unclear. My main problem was how to get urls and games id as variables. But then I thought there already should be programs doing web crawling. I have found Scrapy which use Python language.
    (Maybe I should edit my question, add Scrapy and Python as tags instead of applescript and automator. Is it possible?)
    I have Mac OS 10.6.8, Python 2.6.1. Scrapy needs at least Python 2.7 so I have downloaded the last version of Python (3.3).  I think I can handle the programming in Scrapy thanks to their tutorial. The most difficult part should be... how to install Scrapy. Don't laugh at me.
    I have entered "sudo easy_install Scrapy" in the terminal. But the terminal still uses Python 2.6.1. Python 3.3 is installed but I don't know how to clean update Python. If anyone knows, feel free...
    When I write scrapy in the terminal, here is what I get:
    Traceback (most recent call last):
      File "/usr/local/bin/scrapy", line 4, in <module>
        import pkg_resources
      File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg _resources.py", line 2556, in <module>
        working_set.require(__requires__)
      File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg _resources.py", line 620, in require
        needed = self.resolve(parse_requirements(requirements))
      File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg _resources.py", line 518, in resolve
        raise DistributionNotFound(req)  # XXX put more info here
    pkg_resources.DistributionNotFound: lxml
    It seems Scrapy also needs something called lxml. Right now I am trying to make Python 3.3 the default python version. Is there a web crawler GUI which already includes Python, Scrapy, lxml?
    By default I also have Python 2.4 and 2.5. Does the system need them? I prefer not to delete system files but together all Python versions weigh 500 MB.
    In regard to the real example URL: let's say instantchess.com. Here's a game URL: http://www.instantchess.com/?EXP=1&GPI=84094532
    84094532 is the game id. Let's say I want to search every Reti openings (thus the page must contain the word "Reti") from id 84000000 to 85000000 and store games id in my computer. If I have understood correctly, I need to search through the source code of the pages.
    Feel free to add any remarks, suggestions, ideas.

  • How to hide rows and columns by AppleScript or Automator for printing

    Hello,
    I have to hide first empty rows (I do it by: organize - Column B is not empty)
    then: By context-menu in Header of Column K: Hide column
    and: By context-menu in Header of Column L: Hide column
    How can I make this 3 Steps automatic with AppleScript or Automator or maybe by formula?
    Thanks for any help

    Here is an edited version which allow you to choose the custom template on the fly.
    No need to edit a property in the script.
    --[SCRIPT printtable(s)_choosecustom]
    Enregistrer le script en tant que Script ou Application : printtable(s)_choosecustom.xxx
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Sélectionner une partie de table, une table ou même plusieurs tables.
    Aller au menu Scripts , choisir Numbers puis choisir “printtable(s)_choosecustom”
    Le script crée un nouveau document depuis un modèle perso sélectionné,
    puis applique « Colle les valeurs » au contenu du presse-papiers.
    Il envoie enfin la commande d'impression.
    --=====
    L'aide du Finder explique:
    L'Utilitaire AppleScript permet d'activer le Menu des scripts :
    Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case "Afficher le menu des scripts dans la barre de menus".
    Sous 10.6.x,
    aller dans le panneau "Général" du dialogue Préférences de l'Éditeur Applescript
    puis cocher la case "Afficher le menu des scripts dans la barre des menus".
    --=====
    Save the script as a Script or an Application : printtable(s)_choosecustom.xxx
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    Select a subset of a table, a table or even several tables.
    Go to the Scripts Menu, choose Numbers, then choose “printtable(s)_choosecustom”
    The script create a new document based on the selected custom template,
    then apply “Paste Values” to the clipboard's contents.
    At last, it issue the print command.
    --=====
    The Finder's Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the "Show Script Menu in menu bar" checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2011/02/20
    2011/03/16 -- replaced the Blank template by a custom one defined thru the property custom_template
    2011/03/17 -- Let choose the custom template, no longer Paste but Paste Values.
    --=====
    property theApp : "Numbers"
    --=====
    on run
    --my doyourduty()
    run script doyourduty
    end run
    script doyourduty
    --on doyourduty()
    my activateGUIscripting()
    Copy the selected items *)
    my raccourci(theApp, "c", "c") (* cmd + c *)
    Create a new document based upon Blank.template *)
    set myNewDoc to my makeAnIworkDocFromCustom()
    As it's a custom template, there is no default table to delete.
    Delete the default table *)
    tell application "Numbers" to tell document 1 to tell sheet 1 to delete table 1
    my selectMenu("Numbers", 4, 8) (* Paste Values *)
    my raccourci(theApp, "p", "c") (* cmd + p = Print *)
    my raccourci(theApp, return, "") (* return = validate the Print command*)
    --end doyourduty
    end script
    --=====
    Creates a new iWork document from a custom template and returns its name.
    example:
    set myNewDoc to my makeAnIworkDocFromCustom()
    on makeAnIworkDocFromCustom()
    set nb_chiffres to 3 (*
    2 = allow 99 templates
    3 = allow 999 templates *)
    Grab the localized names of the templates folders *)
    tell application "Numbers"
    set templates_loc to localized string "Templates"
    -- set myTemplates_loc to localized string "My Templates"
    end tell -- to application a
    Define the path to the folder storing custom templates *)
    --set chemindesmodeles to "" & (path to library folder from user domain) & "Application Support:iWork:Numbers:" & templates_loc & ":" & myTemplates_loc & ":"
    set chemindesmodeles to "" & (path to library folder from user domain) & "Application Support:iWork:Numbers:" & templates_loc & ":"
    Grab the list of every items stored in the folder *)
    tell application "Finder"
    set entire_contents to entire contents of folder chemindesmodeles
    end tell
    Build two lists. One contain the path to every custom templates.
    The other contain the names of these templates and the names of subfolders *)
    set indx to 1
    set cheminde_mesmodeles to {}
    set nomsde_mesmodeles to {}
    set le_conteneur to ""
    tell application "System Events"
    repeat with i from 1 to count of entire_contents
    set un_element to item i of entire_contents as text
    try
    if type identifier of disk item un_element is in {"com.apple.iwork.numbers.template", "com.apple.iwork.numbers.sfftemplate"} then
    if name of container of disk item un_element is not le_conteneur then
    set le_conteneur to name of container of disk item un_element
    copy (text 1 thru nb_chiffres of "---") & space & le_conteneur to end of nomsde_mesmodeles
    end if
    copy un_element to end of cheminde_mesmodeles
    copy text -nb_chiffres thru -1 of ("00" & indx) & space & name of disk item un_element to end of nomsde_mesmodeles
    set indx to indx + 1
    end if
    end try
    end repeat
    end tell -- System Events
    if my parleAnglais() then
    set le_titre to "Numbers’s custom templates"
    else
    set le_titre to "Modèles personnalisés de Numbers"
    end if
    Choose the template to use.
    If you select a subfolder name, the script beep and ask one more time *)
    tell application (path to frontmost application as string)
    repeat
    set mon_choix to choose from list nomsde_mesmodeles with title le_titre
    if mon_choix is false then error number -128
    try
    set mon_choix to text 1 thru nb_chiffres of (item 1 of mon_choix) as integer
    exit repeat
    on error
    beep 1
    end try
    end repeat
    end tell
    tell application "Numbers"
    set nb_doc to count of documents
    open (item mon_choix of cheminde_mesmodeles)
    repeat until (count of documents) > nb_doc
    delay 0.1
    end repeat
    set doc_name to name of document 1
    end tell -- the_App
    return doc_name
    end makeAnIworkDocFromCustom
    --=====
    on parleAnglais()
    local z
    try
    tell application theApp to set z to localized string "Cancel"
    on error
    set z to "Cancel"
    end try
    return (z is not "Annuler")
    end parleAnglais
    --=====
    on activateGUIscripting()
    (* to be sure than GUI scripting will be active *)
    tell application "System Events"
    if not (UI elements enabled) then set (UI elements enabled) to true
    end tell
    end activateGUIscripting
    --=====
    ==== Uses GUIscripting ====
    This handler may be used to 'type' text, invisible characters if the third parameter is an empty string.
    It may be used to 'type' keyboard raccourcis if the third parameter describe the required modifier keys.
    I changed its name « shortcut » to « raccourci » to get rid of a name conflict in Smile.
    on raccourci(a, t, d)
    local k
    tell application a to activate
    tell application "System Events" to tell application process a
    set frontmost to true
    try
    t * 1
    if d is "" then
    key code t
    else if d is "c" then
    key code t using {command down}
    else if d is "a" then
    key code t using {option down}
    else if d is "k" then
    key code t using {control down}
    else if d is "s" then
    key code t using {shift down}
    else if d is in {"ac", "ca"} then
    key code t using {command down, option down}
    else if d is in {"as", "sa"} then
    key code t using {shift down, option down}
    else if d is in {"sc", "cs"} then
    key code t using {command down, shift down}
    else if d is in {"kc", "ck"} then
    key code t using {command down, control down}
    else if d is in {"ks", "sk"} then
    key code t using {shift down, control down}
    else if (d contains "c") and (d contains "s") and d contains "k" then
    key code t using {command down, shift down, control down}
    else if (d contains "c") and (d contains "s") and d contains "a" then
    key code t using {command down, shift down, option down}
    end if
    on error
    repeat with k in t
    if d is "" then
    keystroke (k as text)
    else if d is "c" then
    keystroke (k as text) using {command down}
    else if d is "a" then
    keystroke k using {option down}
    else if d is "k" then
    keystroke (k as text) using {control down}
    else if d is "s" then
    keystroke k using {shift down}
    else if d is in {"ac", "ca"} then
    keystroke (k as text) using {command down, option down}
    else if d is in {"as", "sa"} then
    keystroke (k as text) using {shift down, option down}
    else if d is in {"sc", "cs"} then
    keystroke (k as text) using {command down, shift down}
    else if d is in {"kc", "ck"} then
    keystroke (k as text) using {command down, control down}
    else if d is in {"ks", "sk"} then
    keystroke (k as text) using {shift down, control down}
    else if (d contains "c") and (d contains "s") and d contains "k" then
    keystroke (k as text) using {command down, shift down, control down}
    else if (d contains "c") and (d contains "s") and d contains "a" then
    keystroke (k as text) using {command down, shift down, option down}
    end if
    end repeat
    end try
    end tell
    end raccourci
    --=====
    my selectMenu("Numbers",4, 8)
    ==== Uses GUIscripting ====
    on selectMenu(theApp, mt, mi)
    tell application theApp
    activate
    tell application "System Events" to tell process theApp to tell menu bar 1 to ¬
    tell menu bar item mt to tell menu 1 to click menu item mi
    end tell -- application theApp
    end selectMenu
    --=====
    --[/SCRIPT]
    Yvan KOENIG (VALLAURIS, France) jeudi 17 mars 2011 21:29:15

  • Applescript, iMovie and Automator problem

    Hi,
    Sorry for reposting from another area, but maybe this will fair better in the right section.
    I'm trying to convert a .mov file to .mp4 using Visualhub and automator, but a step in my automator file uses an applescript step that just causes the automator flow to stop and the end and not gon one with the rest of the actions.
    More specifically:-
    1. I use my HD camera to film something.
    2. Connect the camera to my mac.
    3. Import the video using iMovie.
    4. My Automator actions ask me to confirm that iMovie has finished the import
    5. Then Ask for finder items, which is get the newly imported .mov into VisualHub
    6. Run the problematic Applescript:-
    on run {input, parameters}
    --we need to unset the default timeout length of two minutes, we'll make it 45
    with timeout of (45 * 60) seconds
    tell application "VisualHub" to set VisualHub to load script (scripts path of main bundle & "/automation.scpt" as POSIX file)
    tell VisualHub
    LoadSettings("/Volumes/MyBook/hd.cam.settings.vhub")
    --SetSaveLocation("YOURHARDDRIVE:Users:YOURNAME:Desktop:iphonemovies:temp")
    AddFiles(input)
    StartConversion()
    QuitApp()
    end tell
    end timeout
    return input
    --delay 15
    end run
    Which I've used from this site (http://professafresh.wordpress.com/2007/10/18/fun-with-automator/) and just stopped the two lines with a comment marker.
    What is supposed to happen after that is that
    7. Automator asks to confirm that VisualHub has finished.
    8. VisualHub quits
    9. Finder finds the .mov that was created when the film was imported
    10. Finder then moves the item to the trash.
    So there is something going on with the applescript that causes the process to stop after the conversion.
    Some points:-
    1. I have used the VisualHub import and convert script step but the default settings are not what I'm after as I want the video resized to 960x540.
    2. iMovie recognizes and keeps all the head info as long as the file name is the same. So if you skip over the thumbnail in iMovie the timestamp changes to reflect the time that the video was taken. If you convert the .mov to .mp4 the info is retained but with a much smaller video size.
    I've tried to give as much info as possible, sorry if it's too much.
    Regards,

    You can do that all in iMovie
    Select 300 photos set the length to 3:15 - Import
    Select all in the timeline. Pick your transition. Set it to .29. Apply.
    Daniel C. Slagle - Keeper of the "Unofficial" iMovie FAQ
    http://iMovie.danslagle.com
    Quad - 2.5 Ghz G5   Mac OS X (10.4)   GeForce 7800 GT, 3G RAM, 250GB & 500GB internals

  • Problem with AppleScript inside automator app

    Creating an Automator Application that I want to run by itself (hence application instead of workflow). The firs thing asks for a folder, then it goes to run the following applescript, followed by some more automator applications and another applescript. Everything works perfectly when i run it inside automator, but when I run it as a standalone app it fails on the first applescript. Here it is:
    on run {input, parameters}
         set aFolder to input
         tell application "Finder"
              set folderName to name of folder aFolder
         end tell
         set value of variable "SeasonNumber" of front workflow to "0" & ((characters -1 thru -1 of folderName) as string)
         return input
    end run
    I'm thinking it has something to do with the fact that I am setting a value to an automator variable (SeasonNumber) but not sure. If so, I have attached the second applescript in case something needs to be fixed in both. Thanks in advance.
    on run {input, parameters}
    set whichFile to input
    set epNum to 1
    set sNumber to get value of variable "SeasonNumber" of front workflow
    repeat with aFile in whichFile
         if epNum < 10 then
              set ifZero to "0"
         else set ifZero to ""
         end if
         set textBox to "What is episode title for S" & (sNumber as string) & "E" & epNum & "?"
         tell application "Finder"
              set filename to name of aFile
              set nameEnding to ((characters -4 thru -1 of filename) as string)
              display dialog textBox default answer ""
              set text_returned to text returned of result
              set name of aFile to "S" & (sNumber as string) & "E" & (ifZero as string) & (epNum as string) & " - " & text_returned & nameEnding                    
         end tell
    set epNum to epNum + 1
    end repeat
    return input
    end run

    Awesome. Figured since now it is just a ask for finder items and run applescript, might as well convert the whole thing to applescript and save as application in script editor. So the first thing is ask for finder items, which I have as:
    set a     set aFolder to (choose folder with prompt "Select Season Folder" default location "afp://DiskStation._afpovertcp._tcp.local/Entertainment/TV Shows") as text
    But I keep getting an error saying that it can't make it into type alias. What is the correct way of changing the default location to this? It is a Folder called TV Shows that is on my NAS, connected through afp. Let me know as I have tried putting POSIX file, I have tried Network/DiskStation/Entertainment/TV Shows, among other things. DiskStation is the server and Entertainment is a partition. Thanks in advance.

  • Mounting a network share via Applescript or Automator causes errors in MS Office apps

    If I connect a network share using an automated process, either using Applescript or Automator, though the share shows up on the Desktop and I can open it and view the various folders and files, MS Office apps including Powerpoint, Excel and Word are unable to open the files.   Each gives a slightly different error message.  In Excel, it looks like this:
    In Word, it's:
    In Powerpoint, it's:
    BUT, if I connect to the server share manually (using Cmnd-K in Finder), all files and folders are properly accessible.  I cannot see any differences between the shares connected by the two different means on the Desktop.  They have the same name, are the same size, etc.; in short, everything about them seems identical.  I even took screen shots of the Get Info page from one of them connected by the different methods:
    "home" connected by Automator:
    and connected manually:
    Does anyone have any ideas as to why this is happening or how to fix it?

    I had the same issue. After upgrading kernel to 3.4.5 today the cifs share mounted with original fstab settings. I believe it was caused by this bug:
    kernel changelog wrote:    The double delimiter check that allows a comma in the password parsing code is
        unconditional. We set "tmp_end" to the end of the string and we continue to
        check for double delimiter. In the case where the password doesn't contain a
        comma we end up setting tmp_end to NULL and eventually setting "options" to
        "end". This results in the premature termination of the options string and hence
        the values of UNCip and UNC are being set to NULL. This results in mount failure
        with "Connecting to DFS root not implemented yet" error.

  • Applescript in Automator File passing question

    Hi All,
    I work for an augmenative communication program in Monterey County. I do general tech stuff for them, like setting up new machines, upgrading RAM, and maintaining a few file shares.
    Many of the staff that make communication aides have to go through many steps to get a picture into the software used to make said communication boards. I'm trying to find a way to help make their job easier by creating an applescript or automator action that can help automate the process.
    The images of the kids and objects are in iPhoto (taken from digital cameras). The end result is to paste them into a program called BoardMaker. Getting the image to the clipboard would be good enough, because pasting is a simple operation.
    Since Automator has the Preview command to resize, that part is very easy. (BoardMaker only accepts low res images and the digital cameras they use are always set too high so we need to bring down the res.)
    After that I have a script action listed below that I was able to find online.
    Here's the script code:
    set myImage to open (choose file)
    tell application "Safari"
    activate
    open myImage
    delay 1
    tell application "System Events"
    tell process "Safari"
    keystroke "c" using {command down}
    end tell
    end tell
    end tell
    This is great, but it asks to choose a file when what we need is it to simply open the image passing through the automator actions.
    This isn't part of my job, I haven't been asked to do this, but I do see a need and I know it would help 20+ teachers and speech therapists to create augmenative communication boards.
    Any help would be great - Thanks.
    Paul
    P.S. I have searched these forums extensively before posting, as well as the net in general. Please don't flame if I missed the post with this answer.

    I tweaked the code as follows, which solved the issue.
    tell application "Preview"
    activate
    delay 1
    tell application "System Events"
    tell process "Preview"
    keystroke "c" using {command down}
    keystroke "q" using {command down}
    end tell
    end tell
    end tell

  • ISquint and Automator?

    Can Automator be used to run iSquint, perhaps with use of a script?
    I would like to create a workflow and save it as a plugin for Finder. I could then right-click a movie file, choose the workflow from the contextual menu, and Automator would open iSquint, convert the movie file, create a new blog entry in iWeb, and place the movie on the new page. I could even add an Action to have Transmit upload the changes to my server. I just don't know how to get Automator to use iSquint the way it will use Quicktime. I do not know about scripts, but i suspect that one could be written, fairly simply, that would do this.
    Thanks for reading, any suggestions are appreciated.

    iSquint is an AppleScript studio app, however it has no hooks and handle for AppleScript frameworks therefore it can NOT be used in Automator. Automator is based on AppleScript technology.
    That said, iSquint uses a whole bunch of shell commands, one of which is ffmpeg, a very well known audio/video encoders/decoders.
    So you probably have more luck using ffmpeg itself, but that is not a slam dunk, because shell commands are notoriously hard to work with, unless you come from Unix old school.

Maybe you are looking for

  • Identifying which part of stored procedure is taking long time

    Hi Everyone, I have a stored procedure which is taking long time to execute.  I am trying to understand which part/query in the stored procedure is taking long time. It involves lots of table variables and n no of queries .Could anyone please help me

  • BPM x Integration Process

    Heya guys, longe time no see. I'd like to start a conversation on the following subject: how do you understand the difference between business processes and XI's integration processes. This idea was inspired by the recurrent confusion that some clien

  • Query In PCR

    Dear All,                  There is rule written for settlment for person who r dead during service.For that calculation we need to get age of the emp. The rule which is written is taking the age ,the command which was written to take that age       

  • Comunication Center error, can't send SMS or MMS

    Hi, after installing the last 2 Pc Suite upgrade, Nokia Comunication center doesn't work no more!! If I try to open it to send an SMS with PC it stops, and give me an error, the details of this are : AppName: communicationcentre.exe     AppVer: 7.1.2

  • Books about SCM?

    Hello, are there any books about the Oracle SCM? I don't mean the SHORT docs which I can find on technet, or is there a guide to the SCM? But as you know, best would be a good old paper book. Thank you very much