Sign in to follow this  
Followers 0
Googler24022

To Mac?

7 posts in this topic

#1 ·  Posted (edited)

I have a script and i was wandering if there is any easy way to make the code work on a Mac Osx Enviroment?

Edited by Googler24022

Share this post


Link to post
Share on other sites



I have a script and i was wandering if there is any easy way to make the code work on a Mac Osx Enviroment?

<{POST_SNAPBACK}>

The only way i could think of is to use a windows emulator or rewrite it in a mac freindly laungauge. :(

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Is this hard to do? Because i have no idea Posted Image

Edited by Googler24022

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Is this hard to do? Because i have no idea.

<{POST_SNAPBACK}>

Emulator? No, take a look at qemu. But an emulator is probably not what you want, as your script will run in an isolated Windows Environment.

Porting the script? Well, it depends on the complexity of your script and if it is "portable". If it uses a lot of windows-specific stuff (RegRead, GUIxxx, etc.) then it will be rather hard to do. Otherwise it might be not so hard to port it to perl, python or ruby. EDIT: and of course AppleScript.

What's your script doing?

Cheers

Kurt

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Heres the script

Posted Image

ProgressOn("Progress Meter", "Loading", "0 percent")

For $i = 10 to 100 step 1

sleep(100)

ProgressSet( $i, $i & " percent")

Next

ProgressSet(100 , "Done", "Complete")

sleep(500)

ProgressOff()

Dim $handleArray[10]

opt("MouseCoordMode", 2)

Global $Paused

HotKeySet("{ESC}", "TogglePause")

For $i = 1 To 10

$url = "http://www.darkthrone.com/recruiter/index.dt?session="

$ObjIE = ObjCreate ("InternetExplorer.Application")

With $ObjIE

.Visible = True

.Navigate ($url)

.FullScreen = False

Do

Sleep(50)

Until .ReadyState = 3

EndWith

$handleArray[$i - 1] = WinGetHandle(WinGetTitle(""))

Next

For $i = 1 To 35

For $y = 1 To 10

WinActivate($handleArray[$y - 1])

While _IsPressed('01') = 0

Sleep(100)

WEnd

Sleep(150)

Next

Next

For $i = 1 To 9

WinClose($handleArray[$i - 1])

Next

Func TogglePause()

$Paused = Not $Paused

While $Paused

Sleep(100)

ToolTip('Script is "Paused"', 0, 0)

WEnd

ToolTip("")

EndFunc ;==>TogglePause

Func _IsPressed($hexKey)

Local $aR, $bRv

$hexKey = '0x' & $hexKey

$aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)

If $aR[0] <> 0 Then

$bRv = 1

Else

$bRv = 0

EndIf

Return $bRv

EndFunc ;==>_IsPressed

Edited by Googler24022

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Heres the script

ProgressOn("Progress Meter", "Loading", "0 percent")

For $i = 10 to 100 step 1

    sleep(100)

    ProgressSet( $i, $i & " percent")

Next

ProgressSet(100 , "Done", "Complete")

sleep(500)

ProgressOff()

Dim $handleArray[10]

opt("MouseCoordMode", 2)

Global $Paused

HotKeySet("{ESC}", "TogglePause")

For $i = 1 To 10

$url = "http://www.darkthrone.com/recruiter/index.dt?session="

$ObjIE = ObjCreate ("InternetExplorer.Application")

With $ObjIE

  .Visible = True

  .Navigate ($url)

  .FullScreen = False

  Do

   Sleep(50)

  Until .ReadyState = 3

EndWith

$handleArray[$i - 1] = WinGetHandle(WinGetTitle(""))

Next

For $i = 1 To 35

For $y = 1 To 10

  WinActivate($handleArray[$y - 1])

  While _IsPressed('01') = 0

   Sleep(100)

  WEnd

  Sleep(150)

Next

Next

For $i = 1 To 9

WinClose($handleArray[$i - 1])

Next

Func TogglePause()

$Paused = Not $Paused

While $Paused

  Sleep(100)

  ToolTip('Script is "Paused"', 0, 0)

WEnd

ToolTip("")

EndFunc   ;==>TogglePause

Func _IsPressed($hexKey)

Local $aR, $bRv

$hexKey = '0x' & $hexKey

$aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)

If $aR[0] <> 0 Then

  $bRv = 1

Else

  $bRv = 0

EndIf

Return $bRv

EndFunc   ;==>_IsPressed

<{POST_SNAPBACK}>

The objects might be hard becuase AFAIK this is a windows only function. (there might be somthing similar on the mac though i don't know.)Also i don't think Internet Explorer runs on the mac. :( Edited by SolidSnake

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

The objects might be hard becuase AFAIK this is a windows only function. (there might be somthing similar on the mac though i don't know.)Also i don't think Internet Explorer runs on the mac.  :)

<{POST_SNAPBACK}>

I believe that IE is fully scriptable with Applescript on OS 9+ and AFAIK on OS X as well.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0