Change Processor Speed with Apple Script?
Can I use AppleScript to change the Processor Speed in System Preferences/Energy Saver pane?
The background is that my PowerBook G4 is quite noisy when it's running on the highest speed. This is okey during the days but on the evenings and nights I want it silent (but still on), so instead of changing this manually I'm thinking of a Script to trigger this.
Please help. :o)
Hi Andreas
yes this can be done using a bit of gui script, the script supplied can be saved as a "application, run only" and activated say from iCal or cron.
"3" is Lowest, so just change the "3" in this line
click menu item 3 of menu 1 of pop up button 1 of tab group 1 of window "Energy Saver"
to 2 or 1 "2" is Highest, "1" is Automatic
and then re-save the script with another name and activate it to change your settings back to where you started.
tell application "System Events"
if not (UI elements enabled) then set UI elements enabled to true
tell application "System Preferences"
set current pane to pane "com.apple.preference.energysaver"
tell application "System Events" to tell process "System Preferences"
set frontmost to true
click radio button "Options" of tab group 1 of window "Energy Saver"
click pop up button 1 of tab group 1 of window "Energy Saver"
click menu item 2 of menu 1 of pop up button 1 of tab group 1 of window "Energy Saver"
delay 0.5
tell application "System Events"
if (name of processes) contains "System Preferences" then tell application "System Preferences" to quit
end tell
end tell
end tell
end tell
Budgie
Similar Messages
-
Processor Speed with Apple Color
Whats the lowest processor a Powermac can have in order to run color at a good rate?
Leftsidedownn wrote:
Whats the lowest processor a Powermac can have in order to run color *at a good rate*?
"At a good rate"
That's pretty subjective. If you're working SD, a Dual 800 G5 is perfectly capable. If you're working HD, just about any Intel-Mac is capable. G5s are also HD-capable, but mileage varies considerably depending on the flavor of HD and the G5 machine.
One key to a solid Color experience is a good video card. Search this forum for suggestions.
The other key is a second monitor - otherwise the interface is very tight and less than productive.
- pi -
Open multi page pdf specific page in Illustrator CS4 with apple script
I need to open multi page pdf specific page in Illustrator CS4 with apple script. Is it something like this:
activate (open file theTargetFolder as PDF with options …).
Thank you.Carlos,
Muchas Gracias por tu colaboración y excelente script, el que se abra el ESTK no tiene mayor importancia.
El caso es que Adobe recomienda encarecidamente NO utilizar Illustrator para editar PDFs, por diversas razones, aunque cuando no hay otro remedio o herramienta disponible, o conocida ...
Para llegar aquí, aparte de San Google, hay que ir a Adobe.es (en mi caso), pestaña de Ayuda, ..... (hasta aqui bien),
luego hay que bajar hasta el final y ver Comunidad y Foros...... (esto puede ser)
al pulsar aparacen un montón de foros se supone de programas pero en inglés,
y la última línea es de International Forums, ya casi hemos llegado)
pulsamos entonces, y por fin se abren cuatro palabras con idiomas, en una dice: español (casi no me lo puede creer)
pincho y llego por fin aquí.
Muy poca gente sabe de la existencia de este pequeño refugio, si a esta dificultad añadimos la peculiar forma de ser de la gente, .... -
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,
-AstraPointHi,
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. -
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/ -
Move a mouse with Apple script
Hello,
I need some apple script code to move a mouse to a certain location and then click. If possible could it record the location of the mouse, move it to the pre-assigned coordinates, click, and them move it back to where it was.
I am doing this so I can use multivid and Qlab to play different videos on different iOS devices. Multivid doesn't seem to let me have a cue list with different videos playing simultaneously.
I will have my iMac set up with 2 displays, one with Qlab and the other with multivid in full screen.
Thanks for the helpHere's another code using rubycocoa you might try.
_rb_click({|:position|:{30, 10}, |:click|:1, |:restore|:true, |:prep|:false})
on _rb_click(desc)
record desc : event descriptor record;
full spec = {|:position|:pos, |:click|:k, |:button|:b, |:flags|:m, |:restore|:r, |:prep|:p}
defaults = {|:position|:{}, |:click|:0, |:button|:1, |:flags|:"", |:restore|:false, |:prep|:true}
list pos : {x, y} or {}
number x, y = x, y global coordinate of position
{} denotes current location
integer k : click count (0, 1, 2 or 3}; 0 denotes only to move mouse and exit
integer b : button index (1 = left button, 2 = right button)
string m : modifier flags; e.g. 'ck' = control + command
a = capslock
s = shift
c = control
o = option
k = command
boolean r : true to restore original mouse location, false otherwise
boolean p : true to post preparatory left 1-click event to change UI context, false otherwise
return list : {x, y} = mouse location at exit
considering numeric strings
if (system info)'s system version < "10.9" then
set ruby to "/usr/bin/ruby"
else
set ruby to "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby"
end if
end considering
set defaults to {|:position|:{}, |:click|:0, |:button|:1, |:flags|:"", |:restore|:false, |:prep|:true}
set {|:position|:pos, |:click|:k, |:button|:b, |:flags|:m, |:restore|:r, |:prep|:p} to desc & defaults
if pos = {} then
set {x, y} to {"%", "%"}
else
set {x, y} to pos
end if
if k is not in {0, 1, 2, 3} then error "invalid click count: " & k number 8000
if b is not in {1, 2} then error "invalid button index: " & b number 8000
if m = "" then set m to "%"
do shell script ruby & " <<'EOF' - " & x & " " & y & " " & k & " " & b & " " & m & " " & r & " " & p & "
require 'osx/cocoa'
include OSX
if ARGV[0..1] == ['%', '%']
pt = CGEventGetLocation(CGEventCreate(nil)) # current mouse location
else
pt = CGPoint.new
pt.x, pt.y = ARGV[0..1].map {|a| a.to_f}
end
clk, btn = ARGV[2..3].map {|a| a.to_i}
flg = ARGV[4]
res, prep = ARGV[5..6].map {|a| a == 'true'}
etype, mbtn = case btn
when 1 then [KCGEventLeftMouseDown, KCGMouseButtonLeft] # [1, 0]
when 2 then [KCGEventRightMouseDown, KCGMouseButtonRight] # [3, 1]
when 3 then [KCGEventOtherMouseDown, KCGMouseButtonCenter] # [25, 2]
else raise ArgumentError, %[invalid mouse button: #{btn}]
end
mtable = {
'a' => KCGEventFlagMaskAlphaShift,
's' => KCGEventFlagMaskShift,
'c' => KCGEventFlagMaskControl,
'o' => KCGEventFlagMaskAlternate,
'k' => KCGEventFlagMaskCommand,
mf = flg.split(//).inject(0) { |mf, x| (m = mtable[x]) ? mf | m : mf }
src = CGEventSourceCreate(KCGEventSourceStateHIDSystemState)
tap = KCGHIDEventTap
pt0 = CGEventGetLocation(CGEventCreate(src)) # current mouse location
# move mouse to target location
ev0 = CGEventCreateMouseEvent(src, KCGEventMouseMoved, pt, 0) # move mouse
CGEventPost(tap, ev0)
if clk == 0
puts pt.x, pt.y
exit
end
# post preparatory left mouse click to change UI context (optional)
if prep
ev1 = CGEventCreateMouseEvent(src, KCGEventLeftMouseDown, pt, KCGMouseButtonLeft) # mouse left button down
CGEventPost(tap, ev1)
CGEventSetType(ev1, KCGEventLeftMouseUp) # mouse left button up
CGEventPost(tap, ev1)
end
# post target mouse click(s) with given flags
ev = CGEventCreateMouseEvent(src, etype, pt, mbtn) # mouse button down
CGEventSetFlags(ev, mf) # set flags
CGEventSetIntegerValueField(ev, KCGMouseEventClickState, clk) # set click count
CGEventPost(tap, ev)
CGEventSetType(ev, etype + 1) # mouse button up
CGEventPost(tap, ev)
# restore mouse location (optional)
if res
CGEventSetLocation(ev0, pt0) # restore mouse location
CGEventPost(tap, ev0)
puts pt0.x, pt0.y
exit
end
puts pt.x, pt.y
EOF"
set rr to paragraphs of result
repeat with r in rr
set r's contents to r as number
end repeat
return rr
end _rb_click -
Selecting Different Printer With Apple Script.
Hi,
I am currently in the process of making a script to be able to print off labels without the need of much user input (read from a document or e-mail) and I want to be able to set the printer when it goes to the print screen.
this is the final apple script step in the application cmd+p brings up the 1st print menu the return takes it to the second print menu cmd+v pastes predifind by the user the ammount of copys they want
on run {input, parameters}
tell application "Labels & Addresses"
activate
tell application "System Events"
keystroke "p" using command down
delay 1
keystroke return
delay 1
keystroke "v" using command down
delay 1
tell application "System Events"
tell process "Labels & Addresses"
click (menu item whose description is "Printer")
click (menu item "Zebra Technologies ZTC GK420t" whose description is "Printer")
end tell
end tell
return input
end tell
end tell
end run
now there is chance to change the printer selection twice once in the 1st print screen and once in the 2nd print screen the only problem is im not sure how to apple script to select the right printer from the drop down menu, I got the code from a forum but I think it was old code as when I tested it it was returning errors so I modified it a bit and now it just struggles finding the menu item with description of printer.
Does anyone know what I would have to use for it to select the right printer? (The Zebra Technologies ZTC GK420t)
Help would be greatly appricited!
Thanks,
Bruce
P.S. sorry the code is a bit messy!Im NOT sure if you have just made this a little over complicated… This works just fine for me. Tested with about a dozen psd layers…
tell application "Adobe InDesign CS2"
tell active document
tell rectangle 1
tell graphic 1
tell graphic layer options
set GLC to count of graphic layers
repeat with i from 1 to GLC
if name of graphic layer i ≠ "Blue" then
set current visibility of graphic layer i to false
else
set current visibility of graphic layer i to true
end if
end repeat
end tell
end tell
end tell
end tell
end tell
This variant also works as I would have expected too… Retaining visibility from a list…
tell application "Adobe InDesign CS2"
tell active document
tell rectangle 1
tell graphic 1
tell graphic layer options
set On_List to {"Red", "Aqua", "Orange"}
set GLC to count of graphic layers
repeat with i from 1 to GLC
if name of graphic layer i is not in On_List then
set current visibility of graphic layer i to false
else
set current visibility of graphic layer i to true
end if
end repeat
end tell
end tell
end tell
end tell
end tell -
How can I get the size of a file with apple script
I try to get the size of a file within an apple script. But I did not find information how to do this.
There are two ways. I think Apple is moving toward using System Events, which is listed first.tell application "Finder"
set myFile to selection as alias
--this just gets a file for me to work with
--coercing it into an alias is required for the other functions
end tell
tell application "System Events"
get size of myFile
end tell
set myInfo to (info for myFile)
get size of myInfo -
Changing SPRM 0 with a script ?
Hi list,
In have searched the archives but I did not found an answer or solution: Is there any way you can change SPRM 0 (menue language) with a script ???
Any help would be great, MichaelHi Chris,
let me first distinguish between a normal menue and a "language menue" which is a menue that is automatically created when you add a second language to the project. Lets say we have got English an Spanish as languages - so in the menue tab you have the option to choose between english and spanish. Now in the scripts I find no way to adress a menue according to it´s language. I can adress the main menue - but wether in english or spanish is no available option. Only choice would be to build a completly seperat menue called "main menue spanish" - okay, I could do that - but what reason is left there for the "language menues" - as nobody sets the DVD player correctly anyway?
But maybe I miss the point - you say "select the correct language based on the users previous selection" - how exactly would you do that? I have stored the users choice in GRPM 0 (eng=0, span=1) and it does change the audiostream and subtitels like expected - how do I change the language ??
michael -
Removing BCC with Apple Script when automatically BCC myself is set in pref
I have "Automatically Bcc myself" set in the Mail Composing preferences, which I like because I get a copy of email that I send. I also have an apple script that forwards messages to an email address. When I used this apple script on Tiger, the BCC option was never added (it might have been a bug with Mail in Tiger); however, now on Leopard, the BCC option is always added when I used the apple script.
I've tried setting the BCC field to Null and Blank, but that doesn't seem to work. I suspect that the field is set upon send or the "make new" directive. Does anyone know a way to tell Mail to not Bcc automatically in an Apple Script?
Here is the forward apple script program:
(* Cf. http://www.macosxhints.com/article.php?story=20060219014940761 *)
(* RS 31st July 2006 *)
set theAuthority to "person AT here"
tell application "Mail"
set theMessages to the selection
repeat with thisMessage in theMessages
set newMessage to make new outgoing message at end of outgoing messages
tell newMessage
set visible to true (* comment out whole line to stop 'blinking' windows *)
set content to thisMessage's source
set subject to "Fwd: " & thisMessage's subject
set bcc to null (* my attempt to set bcc to null or blank *)
make new to recipient with properties {address:theAuthority}
end tell
send newMessage
set read status of thisMessage to true
set was forwarded of thisMessage to true
set junk mail status of thisMessage to true
end repeat
end tellThanks for that reply!
After more google searching, I found this on http://www.macosxhints.com/article.php?story=20040425063255443
One of the responses said that you can add the lines:
delete bcc recipients
delete cc recipients
"in that order" to the new message tell and get rid of the recipients. I had tried the delete before, but I thought I had to get the recipients before I deleted them. I'm not a very good apple script person. Here is my final script
(* Cf. http://www.macosxhints.com/article.php?story=20060219014940761 *)
(* RS 31st July 2006 *)
set theAuthority to "email address here"
(* or your personal Knujon address *)
tell application "Mail"
set theMessages to the selection
repeat with thisMessage in theMessages
set newMessage to make new outgoing message at end of outgoing messages
tell newMessage
set visible to false (* comment out whole line to stop 'blinking' windows *)
set content to thisMessage's source
set subject to "Fwd: " & thisMessage's subject
make new to recipient with properties {address:theAuthority}
delete bcc recipients
delete cc recipients
end tell
send newMessage
set read status of thisMessage to true
set was forwarded of thisMessage to true
set junk mail status of thisMessage to true
end repeat
end tell -
I keep getting a message that my ID has been disabled when trying to download an app. I have changed password with apple. Any ideas what is wrong?
If you've changed your password and it still shows disabled then try logging out of your account on the iPad by tapping on your id in Settings > iTunes & App Stores and then log back in and see if that 'refreshes' the account on it
If that doesn't fix it then you might need to contact iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page -
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 doingNot 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? -
Change Page size with a Script
I have made artwork in Illustrator that is set up as two page spreads on 1 artboard.
I need to convert this to single page spreads.
I.e. So for half the documents, I need to set the anchor point of the document to top left and half the width of the artboard.
For the other half of the documents, I need to set anchor point to to right and half the width.
Is this possible with scripting?
I have look around online to find ways of accessing the document size and anchor point via scripting, but cannot seem to find any resources.
Thanks for any help that can be offered.
Edit: Also is it possible to create a new artboard with a script and assign it a name?here you go, this script splits the artboard in two
// carlos canto
// http://forums.adobe.com/message/5380624#5380624
var idoc = app.activeDocument;
var ab = idoc.artboards[0];
var abBounds = ab.artboardRect;// left, top, right, bottom
var ableft = abBounds[0]; // 0
var abtop = abBounds[1]; // 612
var abright = abBounds[2];
var abbottom = abBounds[3];
var abwidth = abright - ableft; // 792 // width
var abheight = abtop- abbottom; // 0 // height
var half = ableft + abwidth/2;
var abright2 = half;
ab.artboardRect = [ableft, abtop, abright2, abbottom];
var ableft2 = half;
var newAB = idoc.artboards.add([ableft2, abtop, abright, abbottom]); -
How to change registered country with apple
My phone was originally bought in the UK and had a UK SIM in it.
I have now moved to Australia and have a vodafone AU SIM in it.
When I am trying to activate imessage, it is sending the activation text to a UK number. I have updated all my details for itunes etc to my Australian details, but it still continues to send the activation text to the uk. is there a way to update the country for imessage activation with apple?
CheersClick here and request assistance.
(69793) -
Change password with apple script
HI there,
i'm using the do shell script "dscl . -passwd /Users/my username 1"
it runs without problems but its not changing the password.
please advise,
Rafi.You are using "-test" instead of "-passwd" for starters
then you have a space in the username:
do shell script "dscl . -test /Users/ rafi test 123"
should be
do shell script "dscl . -password /Users/rafi test 123"
I am not an expert in dscl, but the best way for you to test whether do shell script is going to work is to run it in Terminal first.
Maybe you are looking for
-
My ipod shuffle 2nd generation is charging but not starting.
My Ipod shuffle 2nd generation 4 yrs old is charging when i connect it to the computer it blinks orange light then when i eject it, it shows green light. But afterwards when i start it nothing happens. It used to work very nicely before but now Its d
-
Digitally Sign All Signature Fields in the Active Document
I have a script which will sign a single digital signature field by the field name. I need to revise the script so it will sign multiple/all signature fields in the active document without having to put the field name in the script, as the field name
-
Camera Roll is out of order after Trimming clips
My iPhone 4 was getting full, so I decided to go and trim down some of the videos I had recorded. Now, the videos on my camera roll are all out of chronological order. The software put them right up front of the list, as if it was using the date I ed
-
Pass audio from optical IN to analog out
Hi Guys, I'm new here, I'm barely get my SB Zx and I'm wondering if I can do this: If is to much problem or is not posible, I'm only need to find a 10ft toslink cable, jeje, is not big deal, but if I can do it on the way of the drawing, is going to b
-
i have been creating numerous projects all with titles. i created a new one tonight by copying an older one - as soon as tried to edit a title pe 8.0 crashes. now i cannot edit any title in previous projects. i have reinstalled pe, deleted all fonts.