applescript

Editing large number of text files

I have about 350 text files which comprise the entire contents of 5 folders on my HD. For each of these files, I would like to delete a specified number of characters at the start and end of each file. I have no knowledge of AppleScript but suspect it may be suitable for what I want to achieve. Any help on automating this would be greatl...

Append a folder name to a path variable in applescript?

set fold to "/Users/Test/Desktop/" set file to "/Myfolder/Hi.txt" how to join these two variables to get my file path as "/Users/Test/Desktop//Myfolder/Hi.txt"? ...

Why does Applescript run in Script Editor, but error when saved as Application?

My applescript needs to detect its own filename, and the following runs fine on Snow Leopard (10.6) set my_name to name of me as string display dialog "Name: " & my_name It displays "Name: AppleScript Editor" when I run it from AppleScript Editor, and it displays "Name: NewTest" when I save it as an application called NewTest. When I...

Automator/Applescript File Sorting and Moving

I was wondering if there was a way in Automator to use Applescript code to get the extension of a file, and if it equals a specific extension (e.g. .pdf or .rtf) move to a specific folder for that extension (e.g if (extension == pdf) { move to folder "~/PDF Files" } else if (extension == rtf) { move to folder "~/Rich Text Files" }) ...

Get current directory of a Finder window from a cocoa application

I'm trying to get a current directory of a finder window that is in focus from another cocoa application that is running in a background. I know that it can be done using an applescript like: tell application "Finder" try set dir to (the target of the front window) as alias on error set dir to startup disk end try end tell However...

How do I move every fourth item in a folder?

I'm trying to make a script that will move every fourth item in a folder to a destination folder. So far I have: tell application "Finder" set originFolder to folder choose folder set dest1Folder to folder choose folder set dest2Folder to folder choose folder set quarter to 1 repeat with i from 1 to count of items in...

AS and FMPA runtime fail on build

OK I have one that doesn't seem to be answered. I'll past the whole script The problem is with the TRY. Since it is happening in the Finder and I am trying to pass some info back to FM. THis works fine as a FM script but fails in the runtime. As far as I can tell the only solution would be to change all the Filemaker Pro Advanced ref...

How do you open a terminal with a specific path already cd'ed to?

How do I use the terminal to open another terminal window but with a path I specify? I am using automator to load my work stuff when I get to work, but I need to know how to do this: Open Terminal and Type: • cd Work/Company/Project/ • script/server And then new tab in that terminal window and cd to the same folder. ...

Reading lyrics from itune to make a file.

...

Cocoa SBridge : how to get the return value (complex type) of applescript

Hello, I'm trying since one month to create an application that detects the current track of iTunes to tag the song and calculate the bpm (through a taping button) When the user modifies one of the field of the tag, the track is locked in the application : that means : if iTunes currentTrack changes, my application stay on the previous...

applescript and magic mouse

I want to applescript the scrolling behaviour of my magic mouse so I can toggle it on and off with a key press. Trouble is, I'm a designer not a developer, so don't have a clue where to even start. I've experimented with Script Editor and Automator and got nowhere. Can someone help or best of all, just write the script for me? I can't be...

objective c "say" command

In applescript there is a say command. Is there something like this for objective c? Thanks, Elijah ...

py-appscript is starting a new Finder instance

i have a py2app application, which runs an appscript using py-appscript. the Applescript code is this one line: app('Finder').update(<file alias of a certain file>) What this normally does is update a file's preview in Finder. It works most of the time, except for Leopard. In Leopard, everytime that script is executed, instead of updat...

AppleScript to create VirtualHost

Hi I'm trying to write an AppleScript which will add new virtualhost by name and absolute path. It works when I try on test files (txt files on desktop) but when I try real files (/private/etc/hosts and /private/etc/apache2/extras/httpd-vhosts.conf) it just does not work. The problem seems to be somewhere around user permissions, but ...

Determining what AppleScript commands an application responds to

Is it possible to ask an OSX application which applescript commands it responds to, and if so, how? ...

AppleScript text delimiters in objective c

Is there an objective c version of text delimiters?? Here's the applescript code: set oldDelim to AppleScript's text item delimiters set AppleScript's text item delimiters to "Jarvis>" set charliePlainOutput to (what ever needs to be parsed) set charlieUnmoddedOutput to last text item of charliePlainOutput set charlieOutputFiltered to...

Apple Script for system preferences

Hi all, In our college we all share the iMacs with same user account, say- Anonymous. So when some other user comes and uses my system, he/she generally changes some of the properties in system preferences. It always wastes some of my precious time when I restore its setting according to mine. So, I am thinking - can I make an app...

Apple Script to set Primary Button, Secondary Button and other properties for Mouse Preference

Hi all, Can anyone suggest me: How to set Primary Button, Secondary Button and other properties of Mouse Preference via AppleScript? I have now tried this, script: tell application "System Preferences" activate end tell tell application "System Events" tell process "System Preferences" click menu item "Mouse" ...

How can I convert a complex applescript into a single line command for the terminal

I have a complex AppleScript that for some reasons has to be executed as a single line command. My Script looks like: tell application "Finder" tell disk "'myDiskName'" open set current view of container window to icon view set toolbar visible of container window to false set statusbar visible of cont...

File name length limit for AppleScript in URL Access Scripting?

I'm having a strange AppleScript issue, and can't seem to figure out the underlying cause, or a solution. I'm trying to download files with a process that mimics the one below. This code fails for me, reporting "URL Access Scripting got an error: Can’t make some data into the expected type." number -1700 to item" If I remove 3 character...