Getting applescript to open
I don't know any code but, I have been wanting to get applescript to open various applicacations when I turn on/reboot my computer.
'... I have been wanting to get applescript to open various applicacations when I turn on/reboot my computer.'
01. Copy the code below ...
set application_List to {"iCal.app", "Stickies.app"} -- List of applications.
set up_Time to do shell script "uptime | awk {'print $3'}" -- Obtain uptime minutes, or hours and minutes, values.
-- The '5' below is for '5 minutes', enough time for a Macintosh to boot. Much less time than the Mac is typically ON.
if ((not (up_Time contains ":")) and (up_Time < 5)) then -- If on for less than '5' minutes - launch desired applications.
repeat with i in application_List -- Cycle through the list of applications, to launch.
tell application i to launch -- Or use 'activate', in place of 'launch'.
end repeat
end if
..., and paste it into 'Script Editor' ('/Applications/AppleScript/').
02. Save the code, via the 'File, Save' menu item, selecting 'Application' from the 'File Format:' popup menu. You have just created an AppleScript applet.
03. Launch (open, run) 'System Preferences', and click on the 'Accounts' utility.
04. Click on 'Accounts' 'LogIn items' tab.
05. Drag the AppleScript applet onto the 'Accounts' window's list.
06. Click on the 'System Preferences' window's (now retitled 'Accounts') 'red' jelly bean crayola crayon 'close' button.
Only when the Mac is rebooted, or turned OFF and later turned ON, will the above applet execute, and the listed applications launched.
If you were to log out and log back in - into the same account, the applet will be executed; but, the listed applications will not be launched..
Mac OS X (10.4.2)
Similar Messages
-
PSCS3 Mac: Can't get Applescript to open "desktop:folder:file.jpg"
I have Photoshop CS3 and am scripting a lengthy workflow, and part of it requires that I get Metadata out of files using Photoshop.
I can not get Photoshop to open a file. Once I have the file open, I can get the metadata out using UI scripting, but I have tried numerous approaches to open files and it has me stumped.
I am making it as a function that I can call from the main script which compares a new list of files with a list that is a few minutes old to determine which files are new and repeats with each file in the list. So the function will be getting a file name or a path.
Any help would be greatly appreciated!
BrianI got it! It needs to be an alias class path, and I had to concatenate the path incrementally before finally the whole path is in one variable I could coerce into an alias.
Of course, this is just one segment of the whole workflow.
tell application "Finder"
activate
set fileList to name of (items of folder "to gallery" of desktop)
repeat
set newFileList to name of (items of folder "to gallery" of desktop)
if length of newFileList > 0 then
repeat with thisFile in newFileList
if thisFile is in fileList then
else
my PSInfoGalAdd(thisFile)
end if
end repeat
set fileList to newFileList
end if
delay 30 --This will eventually be 4 minutes
end repeat
end tell
on PSInfoGalAdd(thisFile)
tell application "Adobe Photoshop CS3"
activate
set desktopPath to path to desktop
set toGalPath to desktopPath & "to gallery:" as string
set wholePath to toGalPath & thisFile
set openIt to wholePath as alias
open openIt
tell application "System Events"
tell process "Adobe Photoshop CS3"
key code 34 using {command down, option down, shift down} --File info window
delay 4
repeat 12 times
key code 125 --down arrow to Origin
delay 0.2
end repeat
repeat 5 times
key code 48 --tab to credit
delay 0.2
end repeat
key code 8 using command down --copy
delay 0.3
set credit to the clipboard
repeat 3 times
key code 48 --tab to instructions
delay 0.2
end repeat
key code 0 using command down --select all
delay 0.3
key code 8 using command down --copy
delay 0.3
set headline to the clipboard
key code 48 --tab to transmission reference
key code 0 using command down --select all
delay 0.3
key code 8 using command down --copy
delay 0.3
set body to the clipboard
key code 48 --tab
key code 36 --return key to dismiss info window
end tell
end tell
end tell
end PSInfoGalAdd -
Using applescript to get iCal to open a file
I'm trying to use AppleScript to get iCal to open a Word doc at a specified date/time.
As a complete novice to AppleScript, I'm sure I have misunderstood how the syntax and grammar of the language work. Would you please advise me how to change this script --
set filepath to POSIX path of "Microsoft Word:Users:mtmanner:Documents:Family JY & Friends:Craig:Craigs Goals:Socializing:Being with people.doc"
try
set command to "open Users/mtmanner/Documents/Family JY & Friends:Craig/Craigs Goals/Socializing/Being with people.doc"
do shell script command
end try
Thanks for your help.There is a useful book called 'AppleScript for Dummies'. Don't be put of by the irritating title: it's actually quite sensibly written and informative (just ignore the occasional facetiousness designed not to frighten nervous readers off). When I was looking for a manual the other books available were much more expensive; I've found this one covers most requirements.
We had three weeks of heatwave: not it's gone unsettled again with rain (which we needed) and temperatures up and down loke the proverbial yo-yo - typical British summer, in other words. -
Applescript to open the Choose Folder dialog box and close the message after moving it
I've been trying to figure out how to get the same functionality as the Windows version of Outlook has so that the open message gets closed when it's moved to another folder.
It seems pretty simple to move a message to a pre-defined folder, but I can't find a way to open the Choose Folder dialog so I could choose the destination folder. I've looked through the dictionary, but couldn't find any direct way to activate the Choose Folder dialog. So I decided to use keystrokes for the job. Here's what I came up with:
on run {}
tell application "Microsoft Outlook"
try
set theMessage to first item of (get current messages)
set folderID to the folder of theMessage
on error errMsg number errNum
set dialogReply to display dialog "Please select one or more messages to file away before running this script." buttons {"Abort"} default button 1
return
end try
-- open the Choose Folder dialog
tell application "System Events" to keystroke "m" using {command down, shift down}
repeat
delay 2
set currentID to the folder of theMessage
if currentID is not folderID then exit repeat
end repeat
-- Close the active message
tell application "System Events" to keystroke "w" using command down
end tell
end run
This is my first attempt to do anything with AppleScript..
Now in addition to using keystrokes instead of Outlook built-in commands to open the Choose Folder dialog and to close the message, I also have another problem. Everytime I run the script from AppleScript Editor, everything runs fine, the message gets moved to the folder I choose and the message also gets closed. When I move the script to "~/Library/Application Support/Microsoft/Office/Outlook Script Menu Items" and start it from inside Outlook, Outlook gets stuck after opening the Choose Folder dialog and I have to force quit Outlook. I added some debuggin to the script and found out that the script keeps running, but I'm unable to select the folder from Outlook and cannot continue.
Anybody have an idea why this is happening?
Regard,
Kris(For the record)
Unchecking "Submit crash reports" in the Firefox [[Options window - Advanced panel]] General tab simply toggles the default of the "Tell Mozilla about this crash so they can fix it" check box in the Mozilla Crash Reporter dialog (upon crash). It does not turn off the Crash Reporter itself.
Related bug report:
* [https://bugzilla.mozilla.org/show_bug.cgi?id=577221 Bug 577221 - Firefox doesn't remember "submit crash report" check box]
The above information has been added to
http://kb.mozillazine.org/Breakpad#Can_I_disable_Crash_Reporter.3F -
How do you get applescript to say multiple things simultaneously?
I'm quite new to applescrips, and although I've written some basic scripts, I can't really do anything useful (since I have no knowledge of how to use Terminal commans or how to run shell scripts).
I've been trying to get applescript to say multiple things at once, in the same OR in different voices, whatever. No matter what I've tried, it either waits for what it's currently saying to finish before saying a new line, or it cuts off all lines but the last one before speaking.
I've tried say all by itself, with stopping current speech, without waiting until completion, or with both of those last 2 at once, like shown here:
say "TESTING" using "Agnes" with stopping current speech without waiting until completion
say "TESTING" using "Alex" with stopping current speech without waiting until completion
(Take off whatever endings you want, I don't even like those there.)
None of them worked. Also, putting a delay in between doesn't work either.
I've also tried saving applescripts that say something as their own scripts and opening those with a different one, like so:
run script file "Macintosh HD:Users:MY NAME:Library:Scripts:TESTING1.scpt"
run script file "Macintosh HD:Users:MY NAME:Library:Scripts:TESTING2.scpt"
But that didn't work either.
I'm stuck and neither Google nor any Apple support threads I could find could help me.
Any help would be much appreciated, thanks.You can try a script I have, and work from that:
set anSwer to the text returned of (display dialog "What text do you want to say?" default answer "") as text
set the_names to {"Fred", "Bruce", "Alex", "Albert", "Ralph", "Junior", "Vicky", "Agnes", "Kathy", "Princess", "Victoria"}
repeat with this_name in the_names
tell application "System Events"
try
say "Using" & this_name & "'s voice..., " & anSwer using this_name
on error
display dialog "Didn't Work" giving up after 3
end try
end tell
end repeat -
Applescript to open application
I need an applescript to open iTunes. What I have so far is:
tell application "iTunes"
activate
end tell
But I also want the applescript to open the main iTunes window if it is not open already. Currently, this script just brings the iTunes application to the foreground, but fails to open the main window.With iTunes, there is only a main browser window, but both Mail and Safari can have multiple windows or documents. In the case of Mail, you would check for existing message viewers and make one if one doesn't already exist:
if (get message viewers) is {} then make new message viewer
Safari is similar to Mail, you would check for existing documents and make a new one if one doesn't already exist:
if (get documents) is {} then make new document
The scripting dictionary of a particular application is up to the developer, and can vary according to what the application does - you need to refer to each dictionary for the specific terminology. -
I cannot get iWeb to open since upgrading to Lion.
Since upgrading to Lion, I cannot get iWeb to open. The the top title bar comes up but I cannot open or create new pages. Checked this on my mum's iMac and it has the same issue.
Any thoughts in resolving?
MGIn Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
To open your domain file in Lion or to switch between multiple domain files Cyclosaurus has provided us with the following script that you can make into an Applescript application with Script Editor. Open Script Editor, copy and paste the script below into Script Editor's window and save as an application.
do shell script "/usr/bin/defaults write com.apple.iWeb iWebDefaultsDocumentPath -boolean no"delay 1
tell application "iWeb" to activate
Just launch the application, find and select the domain file you want to open and it will open with iWeb. It modifies the iWeb preference file each time it's launched so one can switch between domain files.
You can download an already compiled version with this link: iWeb Switch Domain.
WARNING: iWeb Switch Domain will overwrite an existing Domain.sites2 file if you select to create a new domain in the same folder. So rename your domain files once they've been created to something other than the default name.
OT -
Applescript to open Mail & position on screen!!
Hi
I am brand new to Apple scripts and dont have a clue how to program them.
I would like a script to help me check payment emails to entries to a charity bike ride that I have listed in a Filemaker pro database. At the moment I have to re position the mail window and the Filemaker pro window side by side so I can check each email against an entry and then file it.
My goal would be to write a script to organise my desktop for me.
I have programmed Filemaker pro to open a new window positioned itself far left of the desktop. I can then get it to trigger an applescript. Is it possible to get one to open the mail app, go to a particulat folder and then position itself on the desktop to the right so I can see the two windows side by side.
It would be good if I could tell it the absolute postion of the window and even the size then once the script is in place I could just change the values to fine tune.
Thanks in advance.How are you driving Filemaker to position its window? The chances are that positioning Mail.app's windows is just the same.
The bit you're probably missing is in selecting the message in question. That's a two-part thing that involves manipulating a message viewer:
tell application "Mail"
set selected mailboxes of message viewer 1 to mailbox "Stuff"
set selected messages of message viewer 1 to (get message 1 of mailbox "Stuff")
end tell
This script first sets the current message viewer to point to the 'Stuff' mailbox, then it selects the first message in that mailbox. From there you can set the bounds of the message viewer to size and position the window as you like:
set bounds of message viewer 1 to {100, 100, 500, 500} -
I cant get iTunes to open on my macbook pro, when I click on the icon it shows the iTunes name on the top of the page but the library wont open , and when I click the tabs it doesnt do anything. What can I do? Its driving me insane!!
HELP!!On the iTunes menu bar, click the Window tab. Is itunes selected?
-
I am Required to Save before opening a PDF file in FF 10.0.1. How can I get FF to open a PDF as the default?
Check your add-ons:
Cmd+Shift+A
Make sure the Adobe Acrobat NPAPI Plug-in is set to Always Activate. -
I connected an external monitor to my MacBook Pro, but it doesn't open any programs. It Just sits there with a blank screen. How do I get it to open programs and act like a monitor?
Dear Jean:
It sounds like you are trying to get your external monitor to act as the primary viewing screen. For example it would have your Doc, Icons, Etc. In order to make the external monitor the primary screen you have to:
Open System Preferences.
Choose the Displays Icon
There will be several tabs to choose from pick Arrangement
Drag the toolbar to desired display
Let me know if this helps at all!
Lance -
I am trying to use powerpoint but when I open a document I want to work on it does not open on my desktop. It appears as open on mission control but it disappears offscreen. How can I get it to open where i need it and can work on it?
It's almost certainly too late.
The time to create a backup is before a catastrophe. After a catastrophe, it's too late. -
For remote internet access to the WD My Cloud Mirror, I have been advised that ports 80 and 443 must be open in order to reach the WDMyCloudMirror. My Motorola Gateway (Surfboard SB6141) is connected directly to my Airport Extreme (WAN port) which is in turn connected to the WDMyCloudMirror (all by ethernet cables). I do not have FULL instructions on how to properly manually configure the Airport Extreme to open the ports. I have tried an earlier posting which provides many of the steps, but not all of the required information is included (how to determinge the IP address to be assigned, etc.). I did the best I could with the information given, but the test using "YouGetSignal" showed the ports as still closed and attemps to reach the WDMyCloudMirror by the internet failed as well (of course). The WDMyCloudMirror has enough Apple "stuff" included in it (software, I suspect) that an Apple legal acceptance is required for its set-up, yet Western Digital Tecnical Support is unable (or unwilling?) to help with this aspect of its configuration required to work within the Airport Extreme environment. I have returned the WD My Cloud Mirror to Amazon as "not able to work", but I have not given up the hope that I can eventually get the ports open so that I can get this cloud device, or one similar, to permit remote internet access.
Port Forwarding.....or Port Mapping....as Apple calls it is a difficult and complex configuration method for most users. Because there are so many variables involved in this type of setup, it is not possible to provide a step by step guide that will work for everyone with all devices.
It is possible that a setup guide exists for the the WD drive and AirPort Extreme, but you will have to go looking for it on the Internet. Even if you find one, it may not be tailored to your specific situation or needs.
Sometimes, you can do everything right....at least according to someone's article or "how to" guide, and things still will not work correctly.
In situations like this, when you really don't know what to do, you need to enlist the aid of an IT pro, who will know what to do based on your particular products and unique circumstances. Sometimes....they won't be able to get things working either due to particular circumstances.
But, before you do this, I would strongly recommend that you use a Static IP address for your Internet connection with your ISP. If you do not have this now, contact them to ask them if they offer this type of connection. Expect to pay more for this type of service, of course. -
I am a newbie...and I think I did a big no-no as my Ipad isn't working. I synced it to a second computer at work which is a new Imac after already syncing to my pc at home with Itunes. Now it says it can't restore and can't get it to open, getting error messages but can't fix myself. Can anyone help??
iPad can connect only in one iTunes Library. If you want to connect it to a iTunes Library then you have to erase it. You can erase it from iTunes. Make sure you iPad doesn't have a password, or if it has a password make sure that you connect to the computer and enter the password of your iPad
-
I can't get itunes to open and I have restarted my mac, my ipad is currently connected
same problem - its open but no window is opened. All the options are greyed out.
HELP APPLE!
Maybe you are looking for
-
Item Deletion in Purchase order(IDOC)
Hi all, I need to generate idoc for deleting the line item in purchase order,im able to create and change,if i go for deletion,the change indicator in CDHDR table is showing U(change) only not D(delete). valuable inputs will be rewarded....
-
I have the original iPhone 5 (the one released before 5C & 5S) and when I updated to iOS 8 everything was working well and it was great! Last night I updated to iOS 8.0.2 and it does the complete opposite of what it was supposed to do! I lost my cell
-
Windows error 193. Itunes was installed incorrectly !!
After I uploaded the newest version of itunes i have been unable to open my itunes its says it was installed incorrectly to re install, well i have like twenty times and the same error keeps on appearing. Windows error 193 !! Please Help!
-
Hello, We have a requirement to ship low value commodity items in bulk once ( probably in the beginning of the year) but invoice the customer for the same in installments over the year. Just to give an example, the user may ship 10,000 quantity for a
-
Can't get rid of a file (at least it looks liek a file)
I have a file that I can't delete, can't rename, can't open, etc ... I've tried from the Terminal window and still no luck. If I type ls -l the Terminal widow the result is: ls: filename: No such file or directory If I drag it to the trash and empty