Small problem with applescript
Hello Again,
Every day I use a morning script to launch my programs I have to use... and some more things...
Aldo I have a problem with Golive.
When I try to type activate in the editor it makes a bigg A.
Also with cut and past.
and when i run the applescript-program it does all I need ( The golive part is at the end... but when I place it in the middle it's just stops.
I get this fault message : Can't continue <event Coreactv>
and i guess it has something to do with the A-ctivate
Is this a bugg? Or can someone explain this?
I would like to do more after launching Golive..
tell application "Extensis Suitcase X1"
activate
end tell
tell application "Mail"
activate
end tell
tell application "Adobe Photoshop CS"
activate
end tell
tell application "QuarkXPress Passport"
activate
end tell
tell application "Adobe GoLive CS"
Activate
end tell
Some apps don't respond well to tell blocks. I don't have that app to test, but you could try using something like launch "TextEdit" or tell app "Finder" to open posix file "/Applications/TextEdit.app" to improve your results. Sometimes an ignoring application responses block can help too.
Similar Messages
-
I have a small problem with MSI GF4 MX 420
Hi,
I have a small problem with MSI G4MX420-T(S+C) ( MS-8878 ). Exactly with nVidia WDM Video Capture (universal), which " can't be turned on " by Windows XP.
I have also new drivers ...
Could someone help me?
Asus A7V333
Athlon 1700+
128 MB RAM
Thanks !!!If you only have 10 seconds of content in a 15-second composition, then you need to either add more content or shorten your composition.
You can shorten the composition by changing the duration in the composition settings.
Since you're obviously very new to After Effects, I very strongly recommend that you start here to learn After Effects. -
Some small problems with my new 3G iPhone
Having some small problems with my new iPhone, nothing major, just annoying.
1. When I plug my iPhone in to charge/sync my Adobe photoshop keeps trying to download the photos on my iPhone, which causes an error message from Adobe that it can't download and it stops all syncing and removes my iPhone from iTunes. I have to unplug and reinsert USB cable and sometimes it works ok and sometimes I have to reinsert again. Also when charging, it will disconnect, reconnect and the samething all over again, photoshop trying to get photos and an error message.
2. Can't send e-mails via 3G? Only can get, have to connected to a WiFi to send e-mails, or is this normal?When your iPhone includes photos in the Camera Roll, it is also detected as a digital camera when connected to your computer, and whichever app you have selected to import photos will automatically launch to import the photos. If you haven't imported these photos, it is a good idea to do so as with any other digital camera. I import the photos followed by deleting the photos from the iPhone after the import process is complete. If I want any of the imported photos available on my iPhone for viewing, I add the photos to an existing album that is selected to be transferred to my iPhone under the Photos tab for my iPhone sync preferences, or add the photos to a new album followed by selecting the album under the Photos tab followed by a sync.
If your iPhone's Camera Roll does not include any photos that have not been imported, Adobe Photoshop should not launch automatically when your iPhone is connected.
I know how to disable the selected application for photo import from launching automatically regardless with a Mac, but not with Windows.
Regarding the sending email problem, who is the email account provider and does the email account provider have an authenticated SMTP server?
Most ISPs block the use of SMTP servers that are outside of their network or not provided by the ISP being used for your internet connection unless the SMTP server is authenticated. When connected to the internet via AT&T's cellular network, it is no different in this regard. AT&T's SMTP server is included and available by default for use with an email account that does not have an authenticated SMTP server when connected to the internet via AT&T's cellular network, but you probably won't be able to use this SMTP server for sending messages with the account when connected to the internet with your ISP via an available wi-fi network - especially if the email account is provided by your ISP.
I access two email accounts with the iPhone's mail client and both accounts have an authenticated SMTP server. I've never had any problems sending with either account regardless the ISP being used for an available wi-fi network, or when connected via AT&T's cellular network. -
Problems with AppleScript Editor.app in Snow Leopard
I have been using the Satimage.osax scripting addition with Script Editor.app in Leopard without problem. After I upgraded to Snow Leopard, the Script Editor.app was replaced by AppleScript Editor.app in which the following one-line script
change "," into "." in "3,1416"
compiles without error but it gives an error when I try to run it: as if AppleScript Editor.app was not able to load the ScriptingAdditions (despite the fact that it correctly shows the dictionary for the Satimage.osax scripting addition).
When I decided to get back the old "Script Editor.app" and use it in Snow Leopard to run the above script, I found... no error! It ran correctly.
Anybody observed similar problems with the AppleScript Editor.app and ScriptingAdditions?
Can anybody offer a solution other than trash the new AppleScript Editor.app and stick to the old Script Editor.app?Post to the AppleScript forum under OS X Technologies and send a message to Satimage.
-
A small problem with my Zen Xtra 60 turned into a bigger problem. Help me save it
What started as a small problem has grown to a big mess. My Zen xtra 60 GB unit started going to "Rebuilding Library" often. With 5000 Wma's on it, this rebuild was taking 30 minutes. So what I attempted to fix with reloading firmware to recognize the new Windows Media Player version, has left me with a dead unit.
I have followed many of the solutions, that have been able to fix other peoples units, but to no avail. While my computer sees the unit, none of the firmware loads will see the player. I fixed what was said in the register. Went through the 4 options of the "Rescue Mode" on the player, followed several of the knowledge notes on procedures, including hooking unit up to a new Dell Laptop. Exactly the same problem happens on a different computer.
I guess my first step is to get the computer to see the MP3 player when I run a firmware install.
Tell me what to do to save my little player.
Thanks Scottpeschli wrote:
. . . if I don't use [my 30GB Zen Xtra] for day, it re-builds my library and half of the songs are disappeared and also so the "memoryplace" . . .
I've had a similar experience, but to a degree. I've found that if I don't use my <EM>40GB</EM> Zen Xtra for more than one day the player will "re-build" the library... but in my case once the library has been re-built it plays just fine; none of my songs or memory are lost.
Why does the player have to "re-build" the library if the player is not used for a period of time? -
Recursive mergeSort... small problem with infinate recursion.
Basically, I have made a recursive mergeSort method, but there is a small problem...im getting stuck with an eternal recursion, which is obviously followed up swiftly by a stack flow error, problem is I cant see where im going wrong...
The error reads, "Exception in thread "main" java.lang.StackOverflowError at part3.mergeSort(part3.java:56)"
Heres the code... any help is highly appreciated, as I am new to java, and this is for university.
public class part3
public static void main(String[] args)
// Declare array of unsorted values.
int[] values = {1,3,5,7,9,2,4,6,8,10};
// Display unsorted values on screen.
System.out.println("Unsorted Values");
for(int i= 0;i < values.length; i++)
System.out.println(values);
mergeSort(values, values.length);
output(values);
public static void mergeSort(int[] vals, int n)
// Declare necessary values
int lowCount, highCount;
int[] low, high;
int i, j, k;
if (n > 1)
low = new int[n];
high = new int[n];
for(i=0,j=0,k=0; i < n; i++)
if(vals[i] < low.length)
low[j] = vals[i];
j++;
else
high[k] = vals[i];
k++;
lowCount = j;
highCount= k;
mergeSort(low, lowCount);
mergeSort(high, highCount);
for(i = 0; i < lowCount; i++)
vals[i] = low[i];
for(i = 0; i < highCount; i++)
vals[i+lowCount] = high[i];
public static void output(int[] data)
for(int i = 0; i < data.length; i++)
System.out.print(data[i] + " ");
System.out.println();yes sorry, that was it, when i put that code in my class... i get an acception in thread main...
heres the code i now have...
I know i need to add a main method, but im completely unsure of what I need to put inside the main method, if you get what i mean...
sorry for all the hassle... :(
public class part3
* Mergesort algorithm.
* @param a an array of Comparable items.
public static void mergeSort( Comparable [ ] a ) {
Comparable [ ] tmpArray = new Comparable[ a.length ];
mergeSort( a, tmpArray, 0, a.length - 1 );
* Internal method that makes recursive calls.
* @param a an array of Comparable items.
* @param tmpArray an array to place the merged result.
* @param left the left-most index of the subarray.
* @param right the right-most index of the subarray.
private static void mergeSort( Comparable [ ] a, Comparable [ ] tmpArray,
int left, int right ) {
if( left < right ) {
int center = ( left + right ) / 2;
mergeSort( a, tmpArray, left, center );
mergeSort( a, tmpArray, center + 1, right );
merge( a, tmpArray, left, center + 1, right );
* Internal method that merges two sorted halves of a subarray.
* @param a an array of Comparable items.
* @param tmpArray an array to place the merged result.
* @param leftPos the left-most index of the subarray.
* @param rightPos the index of the start of the second half.
* @param rightEnd the right-most index of the subarray.
private static void merge( Comparable [ ] a, Comparable [ ] tmpArray,
int leftPos, int rightPos, int rightEnd ) {
int leftEnd = rightPos - 1;
int tmpPos = leftPos;
int numElements = rightEnd - leftPos + 1;
// Main loop
while( leftPos <= leftEnd && rightPos <= rightEnd )
if( a[ leftPos ].compareTo( a[ rightPos ] ) <= 0 )
tmpArray[ tmpPos++ ] = a[ leftPos++ ];
else
tmpArray[ tmpPos++ ] = a[ rightPos++ ];
while( leftPos <= leftEnd ) // Copy rest of first half
tmpArray[ tmpPos++ ] = a[ leftPos++ ];
while( rightPos <= rightEnd ) // Copy rest of right half
tmpArray[ tmpPos++ ] = a[ rightPos++ ];
// Copy tmpArray back
for( int i = 0; i < numElements; i++, rightEnd-- )
a[ rightEnd ] = tmpArray[ rightEnd ];
} -
Problem with applescript for Numbers
I am new to Applescript and am haveng problems with what seems to be a pretty simple task. I want to check the value of each cell to test for a certain condition and then based on the results increment another cell. I keep getting the following error:
error "Numbers got an error: Can’t make {4, 5} into type integer." number -1700 from {4, 5} to integer
Here is my script:
tell application "Numbers" to tell document 1 to tell sheet "Sheet 1" to tell table "Table 1"
set fNineStart to 4
set fNineEnd to 12
set bNineStart to 14
set bNineEnd to 22
repeat with irow from 8 to 40
set skinscount to 0
repeat with jcol from fNineStart to fNineEnd
set minscore to value of cell (jcol & 5)
if value of cell (jcol & irow) is equal to minscore and the value of cell (jcol & 6) is equal to 1 then
set skinscount to skinscount + 1
end if
end repeat
set the value of cell (27 & irow) to skinscount
end repeat
end tell
Here is the spreadsheet:
Name
1
2
3
4
5
6
7
8
9
Front
Nine
10
11
12
13
14
15
16
17
18
Back
Nine
Total
Net
ESC
score
Skins
Par
4
4
4
5
3
4
5
3
4
36
4
5
3
4
5
3
4
4
4
36
birdie
3
3
3
4
2
3
4
2
3
27
3
4
2
3
4
2
3
3
3
27
eagle
2
2
2
3
1
2
3
1
2
18
2
3
1
2
3
1
2
2
2
18
low score
3
4
4
3
3
4
5
3
4
4
4
3
4
5
3
4
4
4
# of people with min.
1
3
1
1
1
2
4
1
2
16
2
1
2
3
3
2
1
4
2
Skins
HCP
Joe
y
3
3
4
5
5
3
4
5
4
5
38
5
5
4
4
5
3
4
4
5
39
77
74
Bill
y
7
5
4
5
5
4
4
5
4
4Hi fairchild.bill,
Real experts will I hope chime in, but I think one problem is the way you are referring cells:
Instead of:
value of cell (jcol & irow)
I think you need to use something like:
value of cell irow of column jcol
And
value of cell jcol of row irow
Studying examples of scripts for Numbers 3 at macosxautomation.com may give you some ideas on this.
SG -
Problem with applescript dates from Numbers
Can anyone explain this to me please?
tell application "Numbers" to tell table 1 of sheet 1 of front document
set value of cell ("C2") to "=NOW()"
set nowDate to (value of cell "D2")
log nowDate
end tell
results in
26 Mar, 2013 5:10 PM
appearing in cell C2, but the log tells me
(*date Wednesday, 27 March 2013 6:10:14 AM*)
I realise that the date formats will differ - and one of Yvan Koenigs's useful postings explains that when we extract a date from a Numbers table we get a UTC date time value. He also showed how to get rid of that problem with the formula :
="" & ref_to_date_time_cell
But the UTC time when I obtained the above result was 4:10 am on 26th March, not 6:10 am on 27th March. Why is this?
Incidentally, is there a better way of putting the current date into an applescript variable?If your local time is 5:10 PM on the 26th when the UTC time is 4:10 AM on the 26th, your local time is apparently 13 hours ahead of UTC. Therefore, if the UTC time were 5:10 PM on the 26th, your local time would be 6:10 AM on the 27th. There is nothing inconsistant here. Numbers' value is a local time, but AppleScript thinks it is UTC and converts it.
In general, the current date command in AppleScript would be the best way to put the current date into an AppleScript variable; no need to involve Numbers:
set nowDate to current date
(See the Miscellaneous Commands section of the Standard Additions dictionary in your AppleScript Editor.) -
Problems with AppleScript and MS Office 2011
The script below used to work great for converting MS Word files to PDF files. However, sometime during the last few months it has stopped working and will no longer compile without error. Possibly after upgrading to Mavericks but I'm not exactly sure when it stopped working, could have been an update to Office. Anyway, the error I'm getting when I compile is a Syntax Error, "Expected end of line but found class name". The editor highlights "document" in the line "set the_doc to active document". I'm not very familiar with Applescript but I have opened the scripting dictionary for Microsoft Word in the Applescript editor and I do see "active document" as a property of the "document" object. So why doesn't the compiler recognize it? Am I missing something obvious or was there some sort of change in Mavericks that broke this functionality?
I've been pulling my hair out trying to get this script working again but I have not had any luck. I've tried uninstalling and reinstalling Microsoft Office per instructions from Microsoft. I have all the latest updates and patches. Any help would be greatly appreciated.
Here is the original code which used to work just fine.
-- Stephen Norum
-- [email protected]
property pdf_ext : ".pdf"
on remove_extension(file_path)
-- remove the extension if it exists
set stripped to do shell script ("F=" & quoted form of file_path & " ; echo ${F%.*}")
return stripped
end remove_extension
on get_pdf_path(doc_path)
set doc_path to remove_extension(doc_path)
-- Try the simple name first
set pdf_path to (doc_path & pdf_ext)
-- Otherwise, number the pdfs
set counter to 1
tell application "Finder"
repeat while (exists pdf_path)
set pdf_path to (doc_path & " " & counter & pdf_ext)
set counter to counter + 1
end repeat
end tell
return pdf_path
end get_pdf_path
on run {input, parameters}
repeat with file_name in input
tell application "Microsoft Word"
open file_name
set the_doc to active document
set doc_path to path of the_doc
end tell
set pdf_path to get_pdf_path(doc_path)
tell application "Microsoft Word"
save as active document file name pdf_path file format format PDF
close active document
end tell
end repeat
tell application "Finder"
activate
end tell
return input
end runtry this syntax:
tell application "Microsoft Word"
save as (active document) file name pdf_path file format PDF
end tell
Apparently they changed the enumeration label from format PDF to just plain old PDF without bothering to update the scripting dictionary or ensure backward compatibility. If you want to know how they managed to do that, they are still not using sdef or even scriptSuite xml files, but are loading the scripting information from old-school (i.e. os 8 or os 9 style) resource files.
I've occasionally considered writing Microsoft a proposal to redo the Office scripting dictionaries so they are less crazy-making, but I'm not sure I'd survive the attempt. -
Problem with AppleScript command "Duplicate"?
Hi all.
I'm relatively new to AppleScript so I hope I can get some help here.
I'm writing a script for Aperture 3.0.3 that
1. Makes 4 new versions of the currently selected image
2. Applies 4 different image adjustment presets to the new versions.
3. Presents the 4 adjusted versions on screen.
Making duplicate versions with AppleScript was easy enough, but how do I get an ID for the newly created versions? The "Duplicate" command doesn't return any information at all.
How do I talk to image versions created with the duplicate command?
Can anyone help?
Message was edited by: MonostratosHi,
I'm also interested in a script like that. Have you had any success?
I've found this site, where you can purchase a similar script:
http://www.apertureexpert.com/storedetails/applescript-4-up-auto-levels-curves-r gb-luminance.html
/Christian -
I am having a small problem. with Media Go??
I have a program call " Creative MediaSource Go!" but when click on it to open so i can do some setup, nothing happens. Is ee the hour glass then nothing happens. I already updated with creative. please can some one tell me wat i am missing yo get the "Creative MediaSource Go!" to open and run ??
Having this problem too: IT'S REALLY REALLY ANNOYING!!! Anyone have an idea how to sort this?
-
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 runAwesome. 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. -
Small problems with Image Capture
Hi,
When I upload images from my camera, I have a few problems.
When Image Capture automatically opens, there are two different windows, and I never know which one will open. One has choices like Delete and Eject camera. The other window only has choices like Rotate Right and Rotate Left. Is there a way to get the one with more choices to open every time?
When I eject the camera (either by using the choice from the one window) or by quitting Image Capture and dragging the camera icon in the Trash, I seem to always get a Device Removal warning when I shut off the camera.
Thanks,
AllanThe second problem may be cured by using 'reformat' of the memory card, in the camera.
There may be some corruption in the flash memory; or it may be failing.
The first issue, may be relieved if you can find the correct file plists for Image Capture; and
trash those preferences. If the actual application is somehow damaged, it may be possible
to re-install just that application through use of Pacifist (charlessoft, download) to extract
just that item, from the computer's OS X install/restore disc. Without an 'archive & install.'
Hopefully someone will have exact details from experience; since I've not had similar issues.
Usually, I'd use a free image editor such as ToyViewer for Mac; and also Preview, to edit.
Good luck & happy computing! -
Hi,
I'd like to get my generic (Hash)Map back from a textfile, for this I have written a method that reads the file and returns an Object. The only problem I have is that I get the error "java uses unchecked or unsafe operations , ..." with the following code:
Map<Character, TransVal> thisIsMyMap = (HashMap<Character, TransVal>) readFromFile("filename.dat");I thought it would be the same as parsing a String (guess not :-) ):
String s = (String) justAnObject;TransVal is a class that contains a BitSet and an Integer.
Any help plz?
(btw sorry for my english :-s )The reason is that it cannot check, at runtime or at compile time whether or not the cast is valid. It will at runtime check the cast to HashMap (btw, use Map for both the cast and the variable), but it will not check that all the keys are Characters and that all the values are TransVals. What will happen is that somewhere where you actually use the map, if the assumption you are making here is incorrect, there will be a ClassCastException in what appears to be perfectly safe code. If you are positive that your cast is safe, either change the return type of readFromFile or put a @SuppressWarnings("unchecked") annotation on the method and use a java compiler that respects it (eclipse, 1.6, and maybe others, but not sun's 1.5 javac).
-
Small problem with the Nano 6G, and run workouts
Hello! I have sensor Nike IPod Sport Kit, which is in the new Nano 6G is not needed, because the accelerometer (pedometer) is built into the player and is suitable for running. But buying a heart rate monitor transmitter i is upset that it should only be used with the sensor in the shoe. Because when I connect the transmitter Nike to player Nano 6G, and then connected transmitter heart rate monitor and want to start training, the player Nano 6G is looking sensor in the sneaker, although it could well do without him. Request to developers Apple fix this problem so that you can use the transmitter heart rate monitor with built-in accelerometer in the player Nano 6G.
Sorry for the google-translator. Regards, Alex.Alex, exactly what I was looking for...
I tryed to get info from Apple and Nike support but seems nobody knows what I'm tolking about.
I hope Apple will fix it on 6th G even if they'll launch the 7th G.
Max
Maybe you are looking for
-
Scrambled picture in background on photo booth
Have just installed leopard and have been trying to use the new background features in photo booth but the picture is breaking up and scrambling, i have both re started and power off'd but this has not helped. does anyone have a solution please?????
-
Can't see NAS in Finder after upgrade to Yosemite
That's it - before, in Mavericks, my NAS always was visible on the left pane in Finder. Now, it's gone and I can't find a way to access it at all from my MacBook.
-
ITunes 11.1.0.12.6
Just installed iTunes 11.1.0.12.6.... 204 MB....why is it such a large file ? Appreciate input.
-
Hi All, We have the below scenario. We have an asset which is created in year 2006. The depreciation is calculating correctly. Now in 2008 we have posted new additions to this asset. For the additions the depreciation is calculating from 2008. But th
-
Daemons and modules loaded at boot problem
Hi all, i have a problem with my booting time and modules / daemons loaded at boot This is my bootchart: [IMG=http://img195.imageshack.us/img195/4701/bootchartpw.th.png][/IMG] This is my rc.conf # /etc/rc.conf - Main Configuration for Arch Linux # LO