Duplicate Project in Things 3 Using Applescript - applescript

I have tried the following:
tell application "Things3"
set newToDo to duplicate project "project1" to list "Today" with properties {name:"project2"}
end tell
and I get
Things3 got an error: Projects can not be copied. (-1717)
Now I have manually created project2 and I'm trying
tell application "Things3"
repeat with aToDo in to dos of project "project1"
duplicate aToDo to project "project2"
end repeat
end tell
Which gives me
Things3 got an error: Can’t set project "project2" to item 1 of every to do of project "project1".
I'm inferring that I have the Applescript syntax wrong for this second one.
However, while experimenting, I saw an error about not being able to move objects to a project container but I've forgotten what code it was. Is there a way to do this?

Related

Xcode command failed with exit code 1 AND error reading xcodeproj file

The app is being built on another persons computer and then sent to me to test. I am extremely new to this but have been testing apps for a few months. I just don't do programming at all. I can maneuver my way around inside Xcode 7.1 pretty well. However, I do need to fix these errors in order to test this current app. Can someone help me out?
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
I also have another error that reads
Error reading '/Users/logjam3/Desktop/Cosmo Client/Cosmo Client.xcodeproj'
This is exactly the path to where my project is so I don't know why I get this error.
You have to change the prefix header source location. You can do this by searching for prefix header then changing the location by pressing the 'file' icon on the right sidebar of Xcode.

Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack windows app

I have created a C# windows application and after , and i have created my reports using crystal report .and it works fine ,
but now i need to upgrade my interface , so i have created another c# windows application , after finishing my application screens i need my old reports to be embedded on my new interface application ,
what i did was r.click on my application \ add existing item \ selecting the .rpt files ,
but when try to run my application and open the report , application raise an exception "Load Report Failed " .
The Inner Exception was "Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack" .
I have check these solutions :
report file path
rpt file property : Build Action as "Content"
rpt file property : Copy to Output Directory as "Do not Copy"
rpt file properties : Put Empty for Custom Tool and Custom Tool Namespace
Put application is still raise the previous error .
can someone help me to fix this proplem
Use runtime path for loadding report I.e
reportDocument.Load(Application.StartupPath + "\CrystalReport1.rpt");
Make sure report files are placed in specified folder which is directed by this path. use
string str = Application.StartupPath;
to be sure that which folder it refers to then place report files in this folder it will work fine. I faced similar problem like you and then I noticed this path indicates to bin\debug folder while report files in my project were somewhere else I just copied all files to debug folder and its working fine .... cheers
Crystal often gives you missleading error messages.
In my case I've set Copy to Output Directory of *.rpt file to "Do not Copy" (like you have it too) and I was passing the file path to the bin folder (where it doesn't exist) to ((ReportDocument)rpt).Load("[/bin/folder/path/report.rpt]");
->So check if the file(path) you want to load really exist
My Build Action is set to Embedded Resource (was default)
In my case, it was a problem with permission. Check if all users are allowed to access the file.

Method or data member not found compile issue

I have a VB6 project that I didn't create but I have to update, when I go to make the exe I get a compile error: Method or data member not found, and it points too "SCom1.FileReceive" in the code below. When I look at the Main form, the SCom1 control is a PictureBox.
This code has been working for the last 5 years but I don't know why SCom1 is a picturebox, or why I'm getting the error, is it a reference? SCom1 to me looks like a MSComm function? Let me know if anyone has any ideas, I just don't know VB enough to know how to troubleshoot this. Thanks
If SCom1.FileReceive = True Then
WriteToLog (Now() & " FileReceive was true, now false")
SCom1.FileReceive = False
End If
The machine which you have opened the code doesn't have the mscomm32.ocx file or the ocx file not registered properly.
When vb cannot reference an ocx, it'll convert the relevant control to a picture box control.
What you have to do is, close the project without saving. Then open system32 folder and check for mscomm32.ocx file. If the file is not there then you have to download that from the intenet. The register the file using regsvr32 command in command prompt.
After this you can open the vb6 project and start working.
=========================================================
EDIT : Included the update in the comments to the answer, this will help other users in the future... :-)
if the method name doesn't look familiar to a known ocx file (in this case the SCom1.FileReceive), the missing component can be a custom ocx file.
So check on the working machine or in project folder whether there are any ocx file exists in the relevant name (in this case SCom.ocx).
if there is a file exists in such name, register that file using regsvr32 (if not registered), then add that to toolbox, then replace the picture box control with the relevant control (make sure the name tally).

ApplescriptObjC call to NSMakePoint results in exc_bad_access error

This problem really puzzles me, since AppleScriptObjC should handle garbage collection just fine on its own.
Anyway, the steps to reproduce this error are:
Create a new Cocoa-AppleScript-Application project
Insert single call to NSMakePoint anywhere in the project's nameAppDelegate.applescript file. The file should now look something like this:
script testAppDelegate
property parent : class "NSObject"
on applicationWillFinishLaunching_(aNotification)
-- Insert code here to initialize your application before any files are opened
set single_point to NSMakePoint(5, 10) of current application
display alert "X-value of point: " & x of single_point
end applicationWillFinishLaunching_
on applicationShouldTerminate_(sender)
-- Insert code here to do any housekeeping before your application quits
display alert "Terminating"
return current application's NSTerminateNow
end applicationShouldTerminate_
end script
Run the application
The above application will launch and display the alert "X-value of point: 5.0" (as expected), but immediately after the alert it will crash with the following EXC_BAD_ACCESS error in the file main.m: main.m error
Thus, somewhere a call is being made to an object that no longer exists. If we profile the application with NSZombies enabled, it confirms that a zombie has been messaged and gives this additional info: zombie info
I've also tried the same thing with NSMakeRange and NSMakeRect instead, and it gives exactly the same result. I suspect every call to a Core Foundation function will crash the application this way. However, if we as an example call stringValue() of a NSTextField, it works just fine.
Putting the call outside of applicationWillFinishLaunching_ does not solve it either. So what am I doing wrong?
I'm using XCode 4.3.3 on OSX Lion 1.7.4
EDIT: After some further research, I realized I do not need to call NSMakePoint, I could just create an AppleScript record like {|x|:0, |y|:0} and it will work just like an NSPoint object. So that solves it, I guess.

How do I get Xcode to build and run using Applescript?

I am trying to get Xcode to build and run my project using Applescript. This is the same question as How to build & run Xcode with Applescript?, but I think that answer may be out of date, since it doesn't work on my machine. I get this:
execution error: Xcode got an error: The specified object is a property, not an element. (-10008)
I've also tried the following:
tell application "Xcode"
build project "MyProject"
end tell
but it doesn't build, it just returns "missing value".
(Using Xcode 4.0.1, OS X 10.6.8)
I've been having a huge amount of trouble trying to use Applescript with Xcode; I can't find any actual documentation (except the Xcode dictionary, which is very terse), just examples that don't seem to work. Any help would be appreciated.
I'm going to venture to guess that this is an incomplete implementation on Apple's part. The Dictionary states that build is supposed to return a value, but nothing is returned and Xcode does nothing. The following code conforms to the Dictionary exactly, but it doesn't work either.
tell application "Xcode"
set theProject to project 1
set theBuildConfigType to build configuration type 2 of theProject -- "Debug"
set projectBuilt to build theProject using theBuildConfigType without static analysis and transcript
end tell
Just for reference here is the syntax per Script Debugger:
set theResult to build reference ¬
static analysis boolean ¬
transcript boolean ¬
using build configuration type
In Xcode 13, you can do:
tell application "Xcode"
set theProject to active workspace document
set actionResult to build theProject
repeat
if completed of actionResult is true then
exit repeat
end if
delay 0.5
end repeat
set actionResult to run theProject
repeat
if completed of actionResult is true then
exit repeat
end if
delay 0.5
end repeat
end tell

Resources