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
Here are the specs. Desktop, 1 Ethernet, hooked to Wireless router and is my main computer. XP Professional Router, Wireless Linksys WRT54GL Laptop, Wireless card and Ethernet. XP Home Both the Desktop and Laptop can use the internet. The internet ca [More]
The code is below I just want a simple navigation bar that when I click on biography it takes me to the biography page and so on...I even tried the "href" nothing works I try it in live view and it doesnt work I try it out of live view and it st [More]
Ik bought the TM to get a wireless connection and to have a backup unit. Now I can no longer get connected to some websites. No Amazon,Youtube and even Apple! among others. The message I get tells me that the server can not be found. If I use the net [More]
I had to avoid using Firefox 1.0-1, and now Firefox 1.0-2, because of the fact that whenever I click "Open window in new tab", it doesn't go to the link, but just opens a new tab, not actually going anywhere. This is getting pretty annoying, and [More]
1.  I have source system files.(Header file,clasification file) for a dataset     I have a target IDOC with so many structures in one file.           Example:str1,str2,str3....str20 2.I need to upload two files(header/classification) from source syst [More]
Down loaded movie and that took about an hour.This a rental.I hit button to play and now stuck on loading and no movement on the progress bar ? Does the Apple tv store the movie when down loaded ?I restarted the apple TV and got the mini off AirPlay, [More]
What monitors work well with apple computers? And what do I need to connect to the computer?Many Mac users use Dell, NEC, Samsung, etc. monitors because, like PCs, Macs can automatically sense the resolutions available over standard monitor ports. Th [More]
Hello Experts, I have a simple question for Webtools with users and salesman I have 10 Salesmen. which exist in SAP as Salesmen and are linked to their BP. They do not have a SAP user and do not need one since they will never be using SAP rather they [More]
how to print text from iphone 4 without having to screenshot?An iOS cannot be downgraded or uninstalled...Apple has never supported doing this and removes the older iOS version files when a new iOS is released.Read other 3 answers [More]
why can't I open anything with adobe reader I need help getting to open things  dam  it Thank You: Mark MayfieldHi markndi56, Can you please let us know exactly what task you are trying to perform with Adobe Reader?Read other 7 answers [More]