Sitemap

Amicuk Programming Answers

Need help converting old Applescript for Snow Leopard

-0001-11-30   Views:0

Advertisement

Ok, so I've downloaded the app "PowerHour" for mac. It needs to use the date function which is different in Snow Leopard, so I've heard. I don't program in Apple Script so I can't figure out what syntax to use. Can anyone help me fix this code b

Ok, so I've downloaded the app "PowerHour" for mac. It needs to use the date function which is different in Snow Leopard, so I've heard. I don't program in Apple Script so I can't figure out what syntax to use. Can anyone help me fix this code below?
I'm trying to code this because I don't think the original developer has any hand in this program anymore.
The app on macupdate: http://www.macupdate.com/app/mac/24107/power-hour
Here's the part that is giving the errors:
set gameLengthAsDate to (date (zeroTime)) + (enteredMinutes * minutes)
set songLengthAsDate to date (songLength)
set gameStart to current date
set songStart to gameStart
set gameEnd to gameStart + (time of gameLengthAsDate)
set songEnd to songStart + (time of songLengthAsDate)

The replay answer
Advertisement
AppleScript in Snow Leopard is a bit pickier about specifying dates. From the AppleScript Release Notes, "the [date] string must exactly match one of the system date formats".
It looks like the script is using a shortcut to set the time of the current date. I didn't test a modified application (just that the script statements set a valid date), but you might give the following a try:
1) change the following properties (declared at the beginning of the script)property zeroTime : 0
property songLength : 60
2) change the statements that set the time toset gameLengthAsDate to (current date)
set time of gameLengthAsDate to zeroTime + (enteredMinutes * minutes)
set songLengthAsDate to (current date)
set time of songLengthAsDate to songLength

Go to See the other 7 answers

Need help converting old Applescript for Snow Leopard

Category:DefaultRelease time:-0001-11-30Views:130

Ok, so I've downloaded the app "PowerHour" for mac. It needs to use the date function which is different in Snow Leopard, so I've heard. I don't program in Apple Script so I can't figure out what syntax to use. Can anyone help me fix this code b[More]

Applescript and Snow Leopard

Category:DefaultRelease time:-0001-11-30Views:130

I don't know if I'm alone in thinking this, but Applescript support in Snow Leopard seems to have gone a bit off the rails. I'm experiencing random crashes when doing (choose file) and the user uses the search box that now shows in order to find a fi[More]

Converting from excel 2004 to ical with Snow Leopard

Category:DefaultRelease time:-0001-11-30Views:130

tried to import data via iCalMaker but was informed by the software maker that they don t support Snow Leopard. So ... a bit lost. I have the custom of preparing data in Excel, and would want to import some data into iCal. However I cannot find a goo[More]

AppleScript Studio projects under Snow Leopard

Category:DefaultRelease time:-0001-11-30Views:130

I know Apple has depreciated AppleScript Studio, but the documents say old projects can still be used, so I assume there's a way to edit my old AS projects. I have the iPhone SDK with Xcode 3.2 and Interface Builder, but it doesn't recognize my AS pr[More]

ICal AppleScript translation to Snow Leopard

Category:DefaultRelease time:2015-10-11Views:130

(I didn't see an AppleScript section, so if this is posted in the wrong section, I apologize.) I use Event2ToDo (an AppleScript function) to create ToDos in iCal on a daily basis. It is a very helpful tool, and I really want to keep using it. That be[More]

File path applescript broken after snow leopard

Category:DefaultRelease time:2015-10-11Views:130

I was using this script in illustrator cs4 on a mac running 10.5 and all was good tell application "Adobe Illustrator" activate set theName to name of current document set theNamecount to count of theName set thePath to the file path of current[More]

PDF converter for Mac Snow Leopard

Category:DefaultRelease time:-0001-11-30Views:130

What would be the best PDF-converter for my Mac OSX 10.6.4 Snow Leopard? Thanks for advice. VallisWell, I think actually you can try this *PDF converter*. It could convert PDF to Word, PowerPoint, Excel, Epub and 2 other format. Extremely easy to use[More]

Problems with AppleScript Editor.app in Snow Leopard

Category:DefaultRelease time:-0001-11-30Views:130

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 ",&[More]

AppleScript for address book stopped working in snow leopard

Category:DefaultRelease time:-0001-11-30Views:130

I had an AppleScript stop working after upgrade to snow leopard. I select an address and it moves it to a group "envelopes" then prints the address in my current document. Later, I make a mail merge document of "envelopes and print out the[More]

Can anyone help me find the raw converter for Nikon D4/ I have Aperture 3.0 with Snow Leopard. thanks in advance

Category:DefaultRelease time:-0001-11-30Views:130

hi, Having problems finding the correct download for a Nikon D4 raw converter. Can anyone help direct me to the right link? I am using Aperture 3.0 with Snow leopard. thanks in advance MarkNikon D4 is supported by Digital Camera RAW Compatibility Upd[More]

Convert a Mac Pro Server from January 2007 with OS 10.4 Server to Snow Leopard 6.0 (NON SERVER)

Category:DefaultRelease time:-0001-11-30Views:130

I have a Mac Pro Server from January 2007 with OS 10.4 Server installed. I want to convert from OS 10 Server OS to just using Snow Leopard 6.0 (NON SERVER). I have two hard drives installed. What is the best way to do this? Can I just install Snow Le[More]

Hot
Hello Friends, When I execute the report for GL balancees through T.Code: S_ALR_87012043 I get the following error message (Variant SAP&001 of program RFSSLD00 is not   current version) Give me the solution to overcome the above problem in Asset Acco [More]
Hi folks. I've been meaning to install Leopard for ages but have never got round to it (I bought the retail box when it first came out). I have upgraded my RAM to 2GB and my hard drive to 320GB with no problems. My upgraded hard drive has been partit [More]
Before updating I had at least 10GB of free space, but ever since I updated to iOS 8.3, I am repeatedly receiving the Storage Almost Full error.  The last couple days I have deleted 2 or 3 GB of data and apps to free up space, but the error returns t [More]
Heres the site signvisions.com Just made an .oam file for an html5 intro, but software is bogging down and timing out telling me i need to verify my account, then tells me my comp is offline and to connect to the internet, i have intertnet, im sendin [More]
Hi guys. I have this little problem with my iPhone 3g 2.1. It won't open the Watch app, nor the "Date & Time" in the general settings. Everytime I try to open any of 'em, it just simply returns to home screen. Anyone got this problem? How do [More]
Have tried drills to view inserted images in 4-page Pages doc, going thru Finder to view, reinsertion of images, trashed com.apple.iwork.Pages.plist,,reinstalled iworks '05 CD, upgraded to 1.0.2, read copious discussions from gurus, still no joy. Ima [More]
I have found a few notes on exporting/importing applications, but they don't tell me whether the export is a copy or move. I need to keep both schema's versions of the same application. My original version is under my personal schema. I am ready for [More]
Hi All, I have a business requirement as below: 1) Whenever any new condition record is maintained using t-code VK11 and ZSD01(Z Transaction for maintaining specific pricing), it should trigger mail to respective authorised manager for approval. 2) T [More]
I want Dreamweaver to prompt me before putting the file to the testing server when I use the preview in browser function. I'm sure this was the case before, but now it automatically publishes to the testing server whenever I preview. This is a proble [More]
Hi, We are looking into limiting our Sunray wan clients, but I can't seem to find any information on how to implement this vendor option into MS dhcp running on Windows 2003. Any help? Regards Martijn MoretWhat do you mean by limit? Edited by: Zettab [More]